Jason Gotti jason.gotti@gmail.com
Simple use of a topological sort. First create a dictionary then determine order.
You suddenly have a curious aspiration to create a package installer that can handle dependencies. You want to be able to give the installer a list of packages with dependencies, and have it install the packages in order such that an install won’t fail due to a missing dependency. This exercise is to write the code that will determine the order of install.
Package Installer Coding Exercise
npm install
npm start
Add a reference to the library
<script type="text/javascript" src="src/packageInstaller.js"></script>
Create an instance of PackageInstaller and run install()
var packageInstaller = new PackageInstaller(['a:','a:b']);
var results = packageInstaller.install(); // returns a, b