diff --git a/.github/ISSUE_TEMPLATE/request-for-comment-template.md b/.github/ISSUE_TEMPLATE/request-for-comment-template.md
new file mode 100644
index 000000000..bef0a7e12
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/request-for-comment-template.md
@@ -0,0 +1,28 @@
+---
+name: Request for Comment Template
+about: Template for creating an RFC to modify the curriculum
+title: 'RFC: '
+labels: ''
+assignees: ''
+
+---
+
+**Problem:**
+Give a 1 sentence description of a problem with the current OSSU Curriculum. Successful critiques of the curriculum will point out ways that OSSU is failing to uphold [our curricular guidelines](https://github.com/ossu/computer-science/blob/master/CURRICULAR_GUIDELINES.md). Examples are:
+
+* OSSU lists course X as required when the course's topics are elective in our curricular guidelines.
+* OSSU does not having a course to cover required topic X from our curricular guidelines.
+* OSSU lists courses X, Y and Z that cover the same topics when fewer courses could suffice.
+* OSSU recommends course X to teach a topic, but there exists a higher quality course that covers the same material.
+
+**Duration:**
+This should most often be 1 month from the date of posting.
+
+**Background:**
+Give an in depth description of the problem. Describe a solution to the problem. Describe the advantages and disadvantages of this solution. This section should be a few paragraphs.
+
+**Proposal:**
+Give a bullet point list of changes that are being proposed. These can link to a Pull Request.
+
+**Alternatives:**
+Give a bullet point list of alternative ways to address the problem.
diff --git a/.github/workflows/delete-empty-issues.yml b/.github/workflows/delete-empty-issues.yml
new file mode 100644
index 000000000..053404524
--- /dev/null
+++ b/.github/workflows/delete-empty-issues.yml
@@ -0,0 +1,35 @@
+name: Delete empty issues
+on:
+ issues:
+ types:
+ - opened
+jobs:
+ label_issues:
+ runs-on: ubuntu-latest
+ permissions:
+ issues: write
+
+ if: github.event.issue.body == '' || contains(github.event.issue.body, 'Give a 1 sentence description of a problem with the current OSSU Curriculum. Successful critiques of the curriculum will point out ways that OSSU is failing to uphold')
+ steps:
+ - name: Create comment
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'create-comment'
+ token: ${{ secrets.GITHUB_TOKEN }}
+ issue-number: ${{ github.event.issue.number }}
+ body: |
+ Hello @${{ github.event.issue.user.login }}.
+ It looks like you've opened an empty issue or one without a unique problem description.
+ Please understand that this is a popular project, useful to many learners, and empty issues distract maintainers that are trying to help others.
+ If you would like practice with issues, you can follow github documentation to create your own repo:
+ https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository
+ And then in that repo practice creating and editing issues:
+ https://docs.github.com/en/issues/tracking-your-work-with-issues/configuring-issues/quickstart
+
+ We look forward to your future contributions to OSSU, when you are contributing to improve computer science education for learners all over the world!
+ - name: Close issue
+ uses: actions-cool/issues-helper@v3
+ with:
+ actions: 'close-issue'
+ token: ${{ secrets.GITHUB_TOKEN }}
+ issue-number: ${{ github.event.issue.number }}
diff --git a/.gitignore b/.gitignore
index 9e6fe6d95..b24cf9b6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
.idea
*.swp
-*.swo
\ No newline at end of file
+*.swo
+.direnv/
+.envrc
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 000000000..71929b1d5
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,331 @@
+# Change Log
+
+**Note**: The curriculum is currently undergoing review for v9. This consists largely of checking our recommendations against our [curricular guidelines](CURRICULAR_GUIDELINES.md), adding missing topics and cutting redundant or out of scope courses. As Requests for Comment in this effort are completed, changes are made immediately to the curriculum. When the overall review is complete we will notate the version bump to v9.
+
+All notable changes to this project will be documented in this file.
+This project adheres *in spirit* to [Semantic Versioning](http://semver.org/):
+- "MAJOR" updates correspond to changing the topics studied within a subject
+- "MINOR" updates correspond to changing courses without changing the topics
+- "PATCH" updates correspond to aesthetic and non-essential additions/removals or changing order of classes for better progression
+
+## [8.0.0] 2017-11-01
+### Added
+- extras/readings: "The System Design Primer"
+- extras/readings: "Category Theory for Programmers: The Preface"
+- extras/readings: "Programming Languages: Application and Interpretation"
+- extras/readings: "Programming and Programming Languages"
+- CONTRIBUTING: "Learning Git" section to the contributor guidelines page
+- Core Math: Added "Essence of Linear Algebra" as pre-requisite to "Linear Algebra: Foundations to Frontiers"
+
+### Updated
+- Moved "Introduction to Mathematical Thinking" to extras/courses
+- Moved "Hack the Kernel" (ops-class) from Advanced Systems to Core Systems
+- Core Systems: "Operating Systems: Three Easy Pieces" is no longer required, but is recommended as companion text to "Hack the Kernel"
+- Core Theory: Replaced Coursera with Lagunita as the host for Stanford Algorithms, since Coursera uses dark patterns to trick users into paying
+
+## [7.2.2] 2017-07-02
+### Added
+- "Haskell Programming from First Principles" book as a paid alternative to learn Haskell
+- "Think Python" to extras/readings
+- FAQ entries and links under relevant courses
+- "Category Theory: A Gentle Introduction" to extras/readings
+
+## [7.2.1] 2017-05-14
+### Updated
+- Networking course should take 8 weeks to complete
+- Fixed spelling error
+
+### Added
+- Introduction to Haskell course to [extras/courses](extras/courses.md)
+
+## [7.2.0] 2017-04-28
+### Added
+- Software Testing course
+- Link to Stanford Lagunita's Algorithms: Design and Analysis
+- Added link to the section on parametric equations and polar coordinates from MIT's Single Variable Calculus course in order to properly prepare students for Multivariable Calculus
+
+## [7.1.2] 2017-04-22
+### Updated
+- Add link to Mega Project List in the introduction of the Projects section
+
+## [7.1.1] 2017-04-11
+### Updated
+- Final touch to release
+
+## [7.1.0] 2017-04-10
+### Updated
+- Reverted reformat of programming languages course
+
+### Added
+- Reliable Distributed Algorithms courses
+- New Introduction to CS course
+
+## [7.0.2] 2017-03-30
+### Updated
+- Moved optional online learning courses to extras/courses in a new section
+- Moved alternate computer architecture course to extras/courses
+
+### Added
+- Scala specialization under Advanced applications
+
+### Removed
+- Removed all but one choice for required readings to make the curriculum simpler
+
+## [7.0.1] 2017-03-11
+### Updated
+- Fixed link to Bradfield's DIY computer science page
+
+### Added
+- Note under Calculus One with links to errata and course progression recommendations
+- Optional courses under extras:
+ - Strang's course on linear algebra
+ - Berkeley's Structure and Interpretation of Computer Programs
+- Optional readings under extras:
+ - Van Roy's advanced programming book
+ - P&H's computer architecture book
+ - Skiena's algorithms book
+ - Strang's linear algebra book
+ - Database Management Systems book
+ - Tarr's book on creating your own Domain-specific language
+ - Readings from various authors on distributed systems
+
+## [7.0] 2017-03-09
+Complete overhaul of program structure
+
+### Updated
+- Clarified contributor guidelines and moved them to separated file
+- Switched from many subjects to just four subjects with many topics
+- Consolidated free-books.md and paid-books.md into readings.md
+- Consolidated free-courses.md and paid-courses.md into courses.md
+- Replace old "How to Code" with new "How to Code" (Software Development MicroMasters)
+- Replace Princeton Algorithms (moved to [alternative courses](#extras/courses.md)) with Stanford Algorithms
+
+### Added
+- Indicate prerequisites for all courses
+- Requirements: subject/topic requirements and project requirements
+- Required readings on Haskell, Prolog, Operating Systems
+- Courses: Dan Grossman's Programming Languages
+- Courses: From Nand to Tetris
+- Elective course: Intro to Parallel Programming
+- Elective course: LAFF: Programming for Correctness
+- Elective course: Introduction to Mathematical Thinking
+- Elective courses: Electricity and Magnetism
+- Elective courses: MIT's Computation Structures
+- Elective course: Multivariable Calculus
+- Elective course: ops-class.org
+- Elective course: Automata Theory
+- Elective course: Introduction to Logic
+- Elective course: Computational Geometry
+- Elective course: Formal Concept Analysis
+- Elective course: Game Theory
+- Elective specializations:
+ - Robotics
+ - Data Mining
+ - Big Data
+ - Internet of Things
+ - Cloud Computing
+ - Full Stack Web Development
+ - Data Science
+- Pro specializations:
+ - Mastering Software Development in R
+ - Artificial Intelligence Engineer
+ - Machine Learning Engineer
+ - Cybersecurity
+ - Android Developer
+
+### Removed
+- Removed many dead links and obsolete courses
+- Removed per-course project requirement
+- Course: Object-Oriented Programming in Java
+- Course: Functional Programming in Scala
+- Course: Computer Architecture (but left as a footnote)
+- Course: Intro to Theoretical Computer Science
+- Course: Software Processes and Agile Practices
+- Course: Operating Systems & System Programming
+- Course: Introduction to Cyber Security
+- Course: Parallel Computer Architecture and Programming
+- Course: UX Design for Mobile Developers
+
+## [6.0] 2016-10-09
+### Updated
+- Put Calculus One before and together with Mathematics for Computer Science
+- Improve text in "Order of the classes"
+
+### Added
+- Create public Trello board with the new curriculum version
+- Create the section "How to track and show your progress" in "How to use this guide"
+- Add PROJECTS.md file
+- Copy all sections of curriculum to PROJECTS.md
+
+### Removed
+- Remove "Next Goals" section
+- Remove reference to OSSU web app
+
+## [5.1.0] 2016-08-20
+Update to latest version of Math for Computer Science:
+
+### Updated
+- Section: **Math (Discrete Math)**
+ - Mathematics for Computer Science
+
+## [5.0.0] 2016-08-20
+Due to removed course, we had the following updates:
+
+### Removed
+- Section: **Natural Language Processing**
+ - Natural Language Processing
+
+### Added
+- Section: **Natural Language Processing**
+ - Introduction to Natural Language Processing
+
+## [4.1.0] 2016-08-05
+Due to Coursera's platform changes, we had the following updates:
+### Fixed
+- Section: **Big Data**
+ - Introduction to Big Data
+
+## [4.0.0] 2016-07-30
+Due to Coursera's platform changes, we had the following updates:
+
+### Removed
+- Section: **Theory**
+ - Automata
+- Section: **Math (Linear Algebra)**
+ - Coding the Matrix: Linear Algebra through Computer Science Applications
+- Section: **Parallel Computing**
+ - Heterogeneous Parallel Programming
+- Section: **Natural Language Processing**
+ - Natural Language Processing
+
+### Fixed
+- Section: **Computer Networks**
+ - Computer Networks
+- Section: **Compilers**
+ - Compilers
+
+### Added
+- Section: **Theory**
+ - Intro to Theoretical Computer Science
+- Section: **Math (Linear Algebra)**
+ - Linear Algebra - Foundations to Frontiers
+- Section: **Parallel Computing**
+ - Parallel Computer Architecture and Programming
+- Section: **Natural Language Processing**
+ - Natural Language Processing
+
+## [3.0.0] 2016-05-04
+### Removed
+- Section: **Introduction to Computer Science**:
+ - Introduction to Computer Science and Programming Using Python
+ - From Nand to Tetris (Part 1)
+
+### Added
+- Section: **Introduction to Computer Science**:
+ - Introduction to Computer Science - CS50
+
+## [2.0.1] 2016-04-04
+### Fixed
+- Now students should enroll through our [web app](https://ossu.firebaseapp.com).
+
+## [2.0.0] 2016-03-17
+### Fixed
+- Program Design section course's names and links
+
+### Removed
+- **Introduction to Computer Science**:
+ - Introduction to Computer Science
+ - Introduction to Computational Thinking and Data Science
+- **Algorithms**
+ - Analysis of Algorithms
+- **Programming Paradigms**
+ - Principles of Reactive Programming
+- **Math (Calculus)**
+ - Multivariable Calculus
+- **Software Architecture**:
+ - Web Application Architectures
+- **Software Engineering**:
+ - Agile Development Using Ruby on Rails - Basics
+ - Agile Development Using Ruby on Rails - Advanced
+ - Startup Engineering
+- **Computer Architecture**:
+ - The Hardware/Software Interface
+- **Operating Systems**:
+ - Operating System Engineering
+- **Computer Networks**:
+ - Introduction to Computer Networking
+- **Cryptography**:
+ - Applied Cryptography
+
+**ps**: These removed courses are now in the [extras](https://github.com/ossu/computer-science/tree/master/extras) section.
+
+## [1.3.12] 2016-03-17
+### Added
+- How to collaborate: send new links to the extras section
+
+## [1.3.11] 2016-03-06
+### Fixed
+- Nand to Tetris: change name and url
+- UC Berkeley Agile development: change name and url
+- Direct links to specializations
+
+## [1.3.10] 2016-03-06
+### Fixed
+- Link from Systematic Program Design Part 2 course
+
+## [1.3.9] 2015-11-09
+### Fixed
+- Link for the correct Natural Language Processing course
+
+## [1.3.8] 2015-11-07
+### Added
+- Add "Project Suggestions" section with more references
+
+## [1.3.7] 2015-11-01
+### Removed
+- Removed project.md file, moved to **help** repo
+
+## [1.3.6] 2015-10-22
+### Added
+- Latest version of CS 162, Operating Systems and System Programming
+
+## [1.2.6] 2015-10-19
+### Added
+- Badge/Link to the Awesome list
+
+## [1.2.5] 2015-10-16
+### Fixed
+- Fix name of the section and add a hyperlink to it.
+
+## [1.2.4] 2015-10-14
+### Removed
+- Removed citation about public commitment
+
+## [1.2.3] 2015-10-12
+### Changed
+- Updated the prerequisite section for more clarity
+
+## [1.2.2] 2015-10-12
+### Fixed
+- New link to issue intended for students' enrollment
+
+## [1.2.1] 2015-10-11
+### Added
+- Article Git - the simple guide to the prerequisite section
+
+##[1.1.1] 2015-10-11
+### Fixed
+- Fix typos
+ - As MOOC is a "Massive Open Online Course" MOOC course is redundant
+ - Elaborated on "real problem"
+ - Fixed a few small grammatical and wording errors
+
+## [1.1.0] 2015-10-08
+### Added
+- Motivation & Preparation section (optional resources)
+ - Article: MIT Challenge
+ - Course: Learning How to Learn
+
+## [1.0.0] 2015-10-08
+
+Release of the first **complete** version of the Computer Science curriculum
diff --git a/CNAME b/CNAME
new file mode 100644
index 000000000..982d816af
--- /dev/null
+++ b/CNAME
@@ -0,0 +1 @@
+cs.ossu.dev
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..d0d9fb312
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,19 @@
+# Changing the curriculum
+OSSU thrives because of the changes made by our many contributors. Read on for details on how to help every student that follows you.
+## Non-substantive changes
+If you have non-substantive updates to make to the curriculum, such as a course's URL having been moved, spelling/syntax errors, etc., please send a [pull request](https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/) to fix any mistakes that you have found.
+## Substantive changes
+If you have specific and substantive criticisms of the curriculum, i.e. problems related to the progression/content of courses it would be appropriate to [open an issue](https://help.github.com/articles/creating-an-issue/). While it is acceptable to point out problems, all successful changes naturally require a plan for fixing the problem.
+OSSU’s curricular guidelines are [here](CURRICULAR_GUIDELINES.md). Successful critiques of the curriculum will point out ways that OSSU is failing to uphold these guidelines. Examples are:
+
+* OSSU lists a course as required when the course topics are elective in the curricular guide.
+* OSSU not having a course to cover required topics from the curricular guide.
+* OSSU lists multiple courses that cover the same topics when fewer courses could suffice.
+* OSSU recommends a course to teach a topic, but there exists a higher quality course that covers the same material.
+## Other ways to contribute
+### Responding to Issues
+Issues require more than just users to suggest them. Issues require active community members to read and respond to proposals. Even adding simple [emoji reactions](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) can help the community.
+### Engaging with other students
+Learning is enhanced by engaged peers. You can be that peer for someone new to OSSU. When you see a new person posting in Discord, ask them a question about themselves. When you see a cohort starting at _almost_ the right time, join in. Doing so will make OSSU a stronger program for everyone, including you.
+# Personal Customization
+If you want to customize the curriculum for yourself, you are encouraged to [fork this project](https://help.github.com/articles/fork-a-repo/)!
diff --git a/CURRICULAR_GUIDELINES.md b/CURRICULAR_GUIDELINES.md
new file mode 100644
index 000000000..55ab51366
--- /dev/null
+++ b/CURRICULAR_GUIDELINES.md
@@ -0,0 +1,17 @@
+# Curricular Guidelines
+
+[Curriculum Guidelines for Undergraduate Programs in Computer Science](https://www.acm.org/binaries/content/assets/education/cs2013_web_final.pdf)
+
+Our curricular guidelines are from the 2013 report of the Association for Computing Machinery and the Institute of Electrical and Electronics Engineers. This report is the most recent in a series of such reports outlining the expectations of undergraduate degrees in Computer Science. The report outlines critical Knowledge Areas and topics within them. It drills down further to outline specific learning goals, going so far as to outline what concepts a student must be able to explain vs concepts a student must be able to demonstrate using in practice.
+
+The CS2023 is currently under development. Track its progress to release [here](https://csed.acm.org/).
+
+## Organizations publishing:
+
+### The Association for Computing Machinery
+
+The Association for Computing Machinery (ACM) is an international learned society for computing. It was founded in 1947, and is the world's largest scientific and educational computing society. The ACM is a non-profit professional membership group, with more than 100,000 members as of 2011.
+
+### Institute of Electrical and Electronics Engineers
+
+The Institute of Electrical and Electronics Engineers (IEEE) is a professional association formed in 1963 from the amalgamation of the American Institute of Electrical Engineers and the Institute of Radio Engineers. As of 2018, it is the world's largest association of technical professionals with more than 423,000 members in over 160 countries around the world. Its objectives are the educational and technical advancement of electrical and electronic engineering, telecommunications, computer engineering and allied disciplines.
diff --git a/FAQ.md b/FAQ.md
new file mode 100644
index 000000000..879facb9e
--- /dev/null
+++ b/FAQ.md
@@ -0,0 +1,125 @@
+# Frequently Asked Questions
+
+This page answers some questions that we frequently receive about the curriculum.
+If you have questions that aren't answered here, try asking through one of our [community channels](README.md#community).
+If it seems important enough or we get asked that question a lot, we will probably add it here.
+
+Alternatively, you could [contribute](CONTRIBUTING.md) an answer yourself.
+
+## Contents
+
+- [Does OSSU offer a degree?](#does-ossu-offer-a-degree)
+- [How can I review the math prerequisites?](#how-can-i-review-the-math-prerequisites)
+- [What is a good course to learn a language (C++, Rust, Java, etc)?](#what-is-a-good-course-to-learn-a-particular-language)
+- [Why is the Firebase OSSU app different/broken?](#why-is-the-firebase-ossu-app-different-or-broken)
+- [In what order should I take the courses?](#in-what-order-should-i-take-the-courses)
+- [Does every resource in the main curriculum have to be free?](#does-every-resource-in-the-main-curriculum-have-to-be-free)
+- [Are Coursera courses free to access?](#are-coursera-courses-free-to-access)
+- [Is it necessary to purchase the Verified Upgrade for edX courses?](#is-it-necessary-to-purchase-the-verified-upgrade-for-edx-courses)
+- [What are the alt links?](#what-are-the-alt-links)
+- [Why doesn't the curriculum cover/ignore topic X?](#why-doesnt-the-curriculum-coverignore-topic-x)
+- [Why is the curriculum missing some pre-requisites?](#why-is-the-curriculum-missing-some-pre-requisites)
+- [Why require experience with a sizable project before the Software Engineering courses?](#why-require-experience-with-a-sizable-project-before-the-software-engineering-courses)
+- [How can I find a course on a particular subject?](#how-can-i-find-a-course-on-a-particular-subject)
+
+## Questions
+
+### Does OSSU offer a degree?
+No. OSSU creates guides to resources that will empower you to learn the curriculum of an undergraduate degree. Individuals who used to be involved in OSSU may be working with other organizations to offer degrees, but Open Source Society University is not involved in those efforts.
+
+### How can I review the math prerequisites?
+
+See our [Pre-College Math](https://ossu.dev/precollege-math) curriculum for a list of resources to use for reviewing the math prerequisites.
+
+### What is a good course to learn a particular language?
+OSSU focuses on finding the best courses to learn computer science topics, and isn’t focused on finding language-specific courses. If you are looking to learn a particular language or framework there are two great resources to check.
+1. [Hackr.io](https://hackr.io/) allows users to submit and upvote learning resources for topics such as Python or the Java Spring Framework.
+2. Most languages have a community on Reddit. When you find the community’s page, check to see if there is a wiki or sidebar with resources. For example, see [/r/python](https://old.reddit.com/r/Python). Note that the sidebar content can be different depending on whether you use www.reddit.com or old.reddit.com.
+
+### Why is the Firebase OSSU app different or broken?
+
+The OSSU curriculum and ecosystem have been collaboratively built by many individuals. The Firebase app was one such contribution. When it was written, it was with the intention of helping future OSSU students.
+
+Unfortunately, the app has not been updated in many years. It does not reflect updates to the curriculum, it contains links to courses that no longer exist, and it has known bugs that prevent students from logging in.
+
+It is our hope that the creators of the Firebase app can bring the app up to date. Until that time, the firebase app should be considered a deprecated product that is no longer supported.
+
+### In what order should I take the courses?
+
+You have a few different options:
+- You can progress linearly from top to bottom of the page.
+- You can progress linearly through each individual section, but studying different sections in parallel.
+- You can design your own custom progression using the pre-requisites to guide you.
+
+We have designed the curriculum to work for any of the above three styles.
+
+### Does every resource in the main curriculum have to be free?
+
+Yes, that is a core goal of OSSU.
+
+At the same time, we recognize that education is a resource that requires payment to instructors to make it sustainable in the long term.
+Therefore, we respect the business model of websites like edX, which make their materials free but with some paid add-ons, like official certificates or extra interaction with course instructors.
+
+So we only require that the *learning materials* of a resource be free to access, not that every possible add-on be free.
+It would be ideal if graded assignments were always free. In the event that free assessments are not available OSSU looks for alternate assessments to pair with a course.
+
+### Are Coursera courses free to access?
+
+Some courses that require payment to access probably do exist on Coursera, but we don't put those on our curriculum.
+All Coursera courses that we put on the curriculum must, at minimum, be **free to audit**.
+For some courses, all course features are available for free;
+for others (especially those that are part of a specialization), you may only be able to access the lecture videos.
+(If you find the policies have changed for any courses on our curriculum, please tell us!)
+
+Unfortunately, for some courses, Coursera's interface is [very aggressive](https://www.deceptive.design/) about convincing you that you have to pay.
+
+You may see something like this on the course page:
+
+
+
+When attempting to enroll in such a course:
+- Click the blue "Enroll" or "Enroll Now" button.
+- A pop-up will appear.
+- **Do not click** "Start Free Trial", unless you do want to pay.
+- Find the text that says "Audit this course" at the bottom.
+- Click **Audit**.
+
+
+
+### Is it necessary to purchase the Verified Upgrade for edX courses?
+
+If you just want to watch the videos, it is never necessary for any edX course on our curriculum. Note that a number of edX courses only allow students to audit a course for the estimated number of weeks it takes to complete. Students should not begin a course until they are prepared to focus and complete the course.
+
+### What are the alt links?
+
+Sometimes a course is on multiple platforms that are reasonably similar in quality so we have an alt or two linked in case the main one isn't being offered at the time or you prefer the other one. Both are just as good, go with whichever you prefer or whichever is available when you want to take the course.
+
+### Why doesn't the curriculum cover/ignore topic X?
+
+You can read more about our curricular guidelines and the qualifications of the guidelines' authors [here](CURRICULAR_GUIDELINES.md). If you find a topic that is required by our guidelines and is not included in the curriculum, we should make a change! Read more about [contributing to a change](CONTRIBUTING.md).
+
+### Why is the curriculum missing some pre-requisites?
+
+The curriculum assumes two things:
+- You are reasonably fluent in English.
+- You have gotten through a standard high school curriculum that included physics and pre-calculus.
+
+Without these assumptions, the curriculum would be out of control with trying to fill in your knowledge gaps.
+For those who want to study math pre-requisites, read more [here](#how-can-i-review-the-math-prerequisites)
+
+Of course, if you find that the curriculum is missing a pre-requisite for a course that isn't part of a normal high school curriculum, please let us know!
+
+### Why require experience with a sizable project before the Software Engineering courses?
+Software engineering tries to solve the problem of dealing with large programs. Building a sizable program before taking the SE courses will help you understand what SE is trying to solve. We recommend the Jack-to-VM-code compiler project from the nand2tetris course because it's the first project in the curriculum that is complex enough to see value in an SE course. That said, any sizable project will do and can come from outside of the OSSU curriculum. The idea is that you've done some large enough project where the pieces started to feel unmanageable. This experience will expose pain points and lead to a better understanding of SE.
+
+### How can I find a course on a particular subject?
+After completing Core CS, learners are ready to pursue computer science
+topics of their own interest. How can one find a course on a given topic?
+For MOOCs an excellent resource is [Class Central](https://www.classcentral.com/).
+For materials from university courses that are online (but not organized)
+into a MOOC, [awesome-courses](https://github.com/prakhar1989/awesome-courses) and
+[cs-video-courses](https://github.com/Developer-Y/cs-video-courses)
+are good resources. For textbooks, [Goodreads](https://www.goodreads.com/genres/computer-science)
+is a great platform for reader ratings and reviews.
+For learning a particular programming language or framework,
+[see this question](#what-is-a-good-course-to-learn-a-particular-language).
diff --git a/HELP.md b/HELP.md
new file mode 100644
index 000000000..f45250e1f
--- /dev/null
+++ b/HELP.md
@@ -0,0 +1,9 @@
+# Getting help
+## Check the FAQ!
+Please check our [Frequently Asked Questions](FAQ.md) to see if your question has been addressed.
+## Ask in the chat room
+[](https://discord.gg/5pUhfpX) Join the OSSU [Discord server](https://discord.gg/5pUhfpX)! Discord is an online chat service, similar to Slack or IRC where you can chat with other students and get help.
+### Specific problems
+If you need help successfully completing the content of a course or are having general technical difficulties, first reach out to the resources provided by the course (e.g. the course forum on Coursera, edX, etc). If you need additional help after that, post in Discord. **In your post, mention what steps you have already taken to try and solve the problem**.
+### General problems
+If you have general problems with the program not specific to any course, such as preferring textbook-style learning over MOOCs, Discord is a good place to reach out to people who may have great suggestions. You might form a working group that makes the next improvement to OSSU CS! Read more about contributing [here](CONTRIBUTING.md).
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/ncp/LICENSE.md b/LICENSE
similarity index 85%
rename from computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/ncp/LICENSE.md
rename to LICENSE
index e2b9b4135..7c561549d 100644
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/ncp/LICENSE.md
+++ b/LICENSE
@@ -1,6 +1,6 @@
-# MIT License
+The MIT License (MIT)
-###Copyright (C) 2011 by Charlie McConnell
+Copyright (c) 2015-2023 Open Source Society University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 48bff3f38..e29f6660a 100644
--- a/README.md
+++ b/README.md
@@ -1,150 +1,457 @@
-
-
-## References
-
-- [MIT Open Courseware](http://ocw.mit.edu/courses/#electrical-engineering-and-computer-science)
-- [Google - Guide for Technical Development](https://www.google.com/about/careers/students/guide-to-technical-development.html)
-- [Coursera](https://www.coursera.org/)
-- [How can I prepare myself to be a software engineer?](http://qr.ae/fMbg8)
-
-## Topics
-
-- [Computer Science](#computer-science)
-- [Software Testing](#software-testing)
-- [Math](#math)
-- [Operating Systems](#operating-systems)
-- [Networks](#networks)
-- [Databases](#databases)
-- [Cryptography](#cryptography)
-- [Compilers](#compilers)
-- [Artificial Intelligence](#artificial-intelligence)
-- [Machine Learning](#machine-learning)
-- [Natural Language Processing](#natural-language-processing)
-- [Robotics](#robotics)
-- [Graphs](#graphs)
-- [Data Mining](#data-mining)
-- [Parallel Programming](#parallel-programming)
-- [Programming Languages](#programming-languages)
-- [Others](#others)
-
-### Computer Science
-
-1. **[Introduction to Computer Science and Programming](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/) ✍ - [⎙](/computer-science/01-introduction-to-cs-and-programming-mit)**
-1. [Computer Science 101 - Stanford](https://lagunita.stanford.edu/courses/Engineering/CS101/Summer2014/about) / [Other files](http://web.stanford.edu/class/cs101/) - [⎙]()
-1. [Systematic Program Design - Part 1: The Core Method](https://www.edx.org/course/systematic-program-design-part-1-core-ubcx-spd1x#!)
-1. [Systematic Program Design - Part 2: Arbitrary Sized Data](https://www.edx.org/course/systematic-program-design-part-2-ubcx-spd2x)
-1. [Systematic Program Design - Part 3: Arbitrary Sized Data](https://www.edx.org/course/systematic-program-design-part-3-ubcx-spd3x)
-1. [Fundamentals of Computing](https://www.coursera.org/specialization/fundamentalscomputing2/37/certificate)
- 1. [An Introduction to Interactive Programming in Python (Part 1)](https://www.coursera.org/course/interactivepython1) - [⎙](/computer-science/)
- 1. [An Introduction to Interactive Programming in Python (Part 2)](https://www.coursera.org/course/interactivepython2) - [⎙](/computer-science/)
- 1. [Principles of Computing (Part 1)](https://www.coursera.org/course/principlescomputing1) - [⎙](/computer-science/)
- 1. [Principles of Computing (Part 2)](https://www.coursera.org/course/principlescomputing2) - [⎙](/computer-science/)
- 1. [Algorithmic Thinking (Part 1)](https://www.coursera.org/course/algorithmicthink1) - [⎙](/computer-science/)
- 1. [Algorithmic Thinking (Part 2)](https://www.coursera.org/course/algorithmicthink2) - [⎙](/computer-science/)
-1. [Structure and Interpretation of Computer Programs](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/) - [⎙]()
-1. [Elements of Software Construction](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-005-elements-of-software-construction-fall-2011/) - [⎙]()
-1. [Introduction to Algorithms](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/) - [⎙]()
-1. [Design and Analysis of Algorithms](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-design-and-analysis-of-algorithms-spring-2012/) - [⎙]()
-1. [Paradigms of Computer Programming – Fundamentals](https://www.edx.org/course/paradigms-computer-programming-louvainx-louv1-1x-0) - [⎙]()
-1. [Paradigms of Computer Programming – Abstraction and Concurrency](https://www.edx.org/course/paradigms-computer-programming-louvainx-louv1-2x-0) - [⎙]()
-1. [Computer System Engineering](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-033-computer-system-engineering-spring-2009/) - [⎙]()
-1. [Computer Language Engineering](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-035-computer-language-engineering-spring-2010/) - [⎙]()
-1. [Great Ideas in Theoretical Computer Science](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-080-great-ideas-in-theoretical-computer-science-spring-2008/) - [⎙]()
-1. [Performance Engineering of Software Systems](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-172-performance-engineering-of-software-systems-fall-2010/) - [⎙]()
-1. [Engineering Innovation and Design](http://ocw.mit.edu/courses/engineering-systems-division/esd-051j-engineering-innovation-and-design-fall-2012/) - [⎙]()
-1. [Principles of Computer System Design: An Introduction](http://ocw.mit.edu/resources/res-6-004-principles-of-computer-system-design-an-introduction-spring-2009/) - [⎙]()
-1. [How to Process, Analyze and Visualize Data](http://ocw.mit.edu/resources/res-6-009-how-to-process-analyze-and-visualize-data-january-iap-2012/) - [⎙]()
-1. [Advanced Data Structures](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-851-advanced-data-structures-spring-2012/) - [⎙]()
-1. [Advanced Algorithms](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-854j-advanced-algorithms-fall-2008/) - [⎙]()
-1. [Distributed Algorithms](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-852j-distributed-algorithms-fall-2009/) - [⎙]()
-
-### Software Testing
-
-1. [Software Testing](https://www.udacity.com/course/software-testing--cs258) - [⎙]()
-1. [Software Debugging](https://www.udacity.com/course/software-debugging--cs259) - [⎙]()
-
-### Math
-
-1. [Mathematics for Computer Science](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/) - [⎙]()
-1. [Introduction to Logic](https://www.coursera.org/course/intrologic) - [⎙]()
-1. [Linear Algebra](http://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-spring-2010/) - [⎙]()
-1. [Coding the Matrix: Linear Algebra through Computer Science Applications](https://www.coursera.org/course/matrix) - [⎙]()
-1. [Calculus One](https://www.coursera.org/learn/calculus1) - [⎙]()
-1. [Calculus Two](https://www.coursera.org/learn/advanced-calculus) - [⎙]()
-1. [Linear and Discrete Optimization](https://www.coursera.org/course/linearopt) - [⎙]()
-1. [Probabilistic Graphical Models](https://www.coursera.org/course/pgm) - [⎙]()
-1. [Game Theory](https://www.coursera.org/course/gametheory) - [⎙]()
-1. [Statistics One](https://www.coursera.org/course/stats1) - [⎙]()
-1. [AP Statistics](http://stattrek.com/tutorials/ap-statistics-tutorial.aspx) - [⎙]()
-
-### Operating Systems
-
-1. [Operating System Engineering](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-828-operating-system-engineering-fall-2012/) - [⎙]()
-1. [Operating Systems and System Programming](https://www.youtube.com/watch?v=XgQo4JkN4Bw&list=PL3289DD0D0F0CD4A3) - [⎙]()
-
-### Networks
-
-1. [Networks](http://ocw.mit.edu/courses/economics/14-15j-networks-fall-2009/) - [⎙]()
-1. [Network and Computer Security](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-857-network-and-computer-security-spring-2014/) - [⎙]()
-1. [Network Optimization](http://ocw.mit.edu/courses/sloan-school-of-management/15-082j-network-optimization-fall-2010/) - [⎙]()
-
-### Databases
-
-1. [Database Systems](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-830-database-systems-fall-2010/) - [⎙]()
-1. [Database, Internet, and Systems Integration Technologies](http://ocw.mit.edu/courses/civil-and-environmental-engineering/1-264j-database-internet-and-systems-integration-technologies-fall-2013/) - [⎙]()
-
-### Cryptography
-
-1. [Cryptography I](https://www.coursera.org/course/crypto) - [⎙]()
-1. [Applied Cryptography](https://www.udacity.com/course/applied-cryptography--cs387) - [⎙]()
-
-### Compilers
-
-1. [Compilers](https://www.coursera.org/course/compilers) - [⎙]()
-
-### Artificial Intelligence
-
-1. [Artificial Intelligence](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-034-artificial-intelligence-fall-2010/) - [⎙]()
-
-### Machine Learning
-
-1. [Practical Machine Learning](https://www.coursera.org/course/predmachlearn) - [⎙]()
-1. [Machine Learning](https://www.coursera.org/learn/machine-learning) - [⎙]()
-1. [Neural Networks for Machine Learning](https://www.coursera.org/course/neuralnets) - [⎙]()
-
-### Natural Language Processing
-
-1. [Natural Language Processing](https://www.coursera.org/course/nlangp) - [⎙]()
-1. [Natural Language Processing](https://www.coursera.org/course/nlp) - [⎙]()
-
-### Robotics
-
-### Graphs
-
-### Data Mining
-
-1. [Data Mining](https://www.coursera.org/specialization/datamining/20?utm_medium=catalog) - [⎙]()
-
-### Parallel Programming
-
-1. [Parallel Computing](http://ocw.mit.edu/courses/mathematics/18-337j-parallel-computing-fall-2011/) - [⎙]()
-1. [Heterogeneous Parallel Programming](https://www.coursera.org/course/hetero) - [⎙]()
-
-### Programming Languages
-
-1. [Practical Programming in C](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-087-practical-programming-in-c-january-iap-2010/) - [⎙]()
-1. [Introduction to C Memory Management and C++ Object-Oriented Programming](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-088-introduction-to-c-memory-management-and-c-object-oriented-programming-january-iap-2010/) - [⎙]()
-1. [Effective Programming in C and C++](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-s096-effective-programming-in-c-and-c-january-iap-2014/) - [⎙]()
-
-### Others
-
-1. [Introduction to Functional Programming](https://www.edx.org/course/introduction-functional-programming-delftx-fp101x#!)
-1. [Engineering Software as a Service](https://www.edx.org/course/engineering-software-service-uc-berkeleyx-cs169-1x)
-1. [Engineering Software as a Service, Part 2](https://www.edx.org/course/engineering-software-service-part-2-uc-berkeleyx-cs169-2x#!)
-1. [Automata, Computability, and Complexity](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-045j-automata-computability-and-complexity-spring-2011/) - [⎙]()
-1. [Computational Biology: Genomes, Networks, Evolution](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-047-computational-biology-genomes-networks-evolution-fall-2008/) - [⎙]()
-1. [Creating Video Games](http://ocw.mit.edu/courses/comparative-media-studies-writing/cms-611j-creating-video-games-fall-2013/) - [⎙]()
-1. [Computer Graphics](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-837-computer-graphics-fall-2012/) - [⎙]()
-1. [User Interface Design and Implementation](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-831-user-interface-design-and-implementation-spring-2011/) - [⎙]()
-1. [Making Sense of Data](https://datasense.withgoogle.com/course) - [⎙]()
-1. [Data Science](https://www.coursera.org/specialization/jhudatascience/1?utm_medium=courseDescripTop) - [⎙]()
+
+
+
Open Source Society University
+
+ Path to a free self-taught education in Computer Science!
+
+
+# Contents
+
+- [Summary](#summary)
+- [Community](#community)
+- [Curriculum](#curriculum)
+- [Code of conduct](#code-of-conduct)
+- [Team](#team)
+
+# Summary
+
+The OSSU curriculum is a **complete education in computer science** using online materials.
+It's not merely for career training or professional development.
+It's for those who want a proper, *well-rounded* grounding in concepts fundamental to all computing disciplines,
+and for those who have the discipline, will, and (most importantly!) good habits to obtain this education largely on their own,
+but with support from a worldwide community of fellow learners.
+
+It is designed according to the degree requirements of undergraduate computer science majors, minus general education (non-CS) requirements,
+as it is assumed most of the people following this curriculum are already educated outside the field of CS.
+The courses themselves are among the very best in the world, often coming from Harvard, Princeton, MIT, etc.,
+but specifically chosen to meet the following criteria.
+
+**Courses must**:
+- Be open for enrollment
+- Run regularly (ideally in self-paced format, otherwise running multiple times per year)
+- Be of generally high quality in teaching materials and pedagogical principles
+- Match the curricular standards of the [CS 2013](CURRICULAR_GUIDELINES.md): Curriculum Guidelines for Undergraduate Degree Programs in Computer Science
+
+When no course meets the above criteria, the coursework is supplemented with a book.
+When there are courses or books that don't fit into the curriculum but are otherwise of high quality,
+they belong in [extras/courses](extras/courses.md) or [extras/readings](extras/readings.md).
+
+**Organization**. The curriculum is designed as follows:
+- *Intro CS*: for students to try out CS and see if it's right for them
+- *Core CS*: corresponds roughly to the first three years of a computer science curriculum, taking classes that all majors would be required to take
+- *Advanced CS*: corresponds roughly to the final year of a computer science curriculum, taking electives according to the student's interests
+- *Final Project*: a project for students to validate, consolidate, and display their knowledge, to be evaluated by their peers worldwide
+
+**Duration**. It is possible to finish within about 2 years if you plan carefully and devote roughly 20 hours/week to your studies. Learners can use [this spreadsheet](https://docs.google.com/spreadsheets/u/3/d/1Std_G_5dnajzm289vlsthIJPFnuxN5yOYNDOoiz9Juc/copy) to estimate their end date. Make a copy and input your start date and expected hours per week in the `Timeline` sheet. As you work through courses you can enter your actual course completion dates in the `Curriculum Data` sheet and get updated completion estimates.
+
+> **Warning:** While the spreadsheet is a useful tool to estimate the time you need to complete this curriculum, it may not always be up-to-date with the curriculum. Use the [OSSU CS website](https://cs.ossu.dev) or [the repo](https://github.com/ossu/computer-science) to see what courses to do.
+
+**Cost**. All or nearly all course material is available for free. However, some courses may charge money for assignments/tests/projects to be graded.
+Note that both [Coursera](https://www.coursera.support/s/article/209819033-Apply-for-Financial-Aid-or-a-Scholarship?language=en_US) and [edX](https://courses.edx.org/financial-assistance/) offer financial aid.
+
+Decide how much or how little to spend based on your own time and budget;
+just remember that you can't purchase success!
+
+**Process**. Students can work through the curriculum alone or in groups, in order or out of order.
+- We recommend doing all courses in Core CS, only skipping a course when you are certain that you've already learned the material previously.
+- For simplicity, we recommend working through courses (especially Core CS) in order from top to bottom. Some students choose to study multiple courses at a time in order to vary the material they are working on in a day/week. A popular option is to take the math courses in parallel with the introductory courses. Course prerequisites are listed to help you determine if you are prepared for a given course.
+- Courses in Advanced CS are electives. Choose one subject (e.g. Advanced programming) you want to become an expert in and take all the courses under that heading. You can also create your own custom subject; the Discord community may provide feedback on your planned subject.
+
+**Content policy**. If you plan on showing off some of your coursework publicly, you must share only files that you are allowed to.
+*Respect the code of conduct* that you signed in the beginning of each course!
+
+**[How to contribute](CONTRIBUTING.md)**
+
+**[Getting help](HELP.md)** (Details about our FAQ and chatroom)
+
+# Community
+
+- We have a Discord server! [](https://discord.gg/wuytwK5s9h) This should be your first stop to talk with other OSSU students. Why don't you introduce yourself right now? [Join the OSSU Discord](https://discord.gg/wuytwK5s9h)
+- You can also interact through GitHub issues. If there is a problem with a course, or a change needs to be made to the curriculum, this is the place to start the conversation. Read more [here](CONTRIBUTING.md).
+- Add **Open Source Society University** to your [Linkedin](https://www.linkedin.com/school/11272443/) profile!
+
+> **Warning:** There are a few third-party/deprecated/outdated material that you might find when searching for OSSU. We recommend you to ignore them, and only use the [OSSU CS website](https://cs.ossu.dev) or [OSSU CS Github Repo](https://github.com/ossu/computer-science). Some known outdated materials are:
+> - An unmaintained and deprecated firebase app. Read more in the [FAQ](./FAQ.md#why-is-the-firebase-ossu-app-different-or-broken).
+> - An unmaintained and deprecated trello board
+> - Third-party notion templates
+
+# Curriculum
+
+- [Prerequisites](#prerequisites)
+- [Intro CS](#intro-cs)
+- [Core CS](#core-cs)
+ - [Core programming](#core-programming)
+ - [Core math](#core-math)
+ - [CS Tools](#cs-tools)
+ - [Core systems](#core-systems)
+ - [Core theory](#core-theory)
+ - [Core security](#core-security)
+ - [Core applications](#core-applications)
+ - [Core ethics](#core-ethics)
+- [Advanced CS](#advanced-cs)
+ - [Advanced programming](#advanced-programming)
+ - [Advanced systems](#advanced-systems)
+ - [Advanced theory](#advanced-theory)
+ - [Advanced information security](#advanced-information-security)
+ - [Advanced math](#advanced-math)
+- [Final project](#final-project)
+
+---
+
+## Prerequisites
+
+- [Core CS](#core-cs) assumes the student has already taken [high school math](https://ossu.dev/precollege-math), including algebra, geometry, and pre-calculus.
+- [Advanced CS](#advanced-cs) assumes the student has already taken the entirety of Core CS
+and is knowledgeable enough now to decide which electives to take.
+- Note that [Advanced systems](#advanced-systems) assumes the student has taken a basic physics course (e.g. AP Physics in high school).
+
+## Intro CS
+
+This course will introduce you to the world of computer science and programming. This course gives you a flavor of the material to come. If you finish the course wanting more, Computer Science is likely for you!
+
+**Topics covered**:
+`computation`
+`imperative programming`
+`basic data structures and algorithms`
+`and more`
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[Introduction to Computer Science and Programming using Python](coursepages/intro-cs/README.md) | 14 weeks | 6-10 hours/week | [high school algebra](https://ossu.dev/precollege-math) | [chat](https://discord.gg/jvchSm9)
+
+## Core CS
+
+All coursework under Core CS is **required**, unless otherwise indicated.
+
+### Core programming
+**Topics covered**:
+`functional programming`
+`design for testing`
+`program requirements`
+`common design patterns`
+`unit testing`
+`object-oriented design`
+`static typing`
+`dynamic typing`
+`ML-family languages (via Standard ML)`
+`Lisp-family languages (via Racket)`
+`Ruby`
+`and more`
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[Systematic Program Design](coursepages/spd/README.md) | 13 weeks | 8-10 hours/week | none | chat: [part 1](https://discord.gg/RfqAmGJ) / [part 2](https://discord.gg/kczJzpm)
+[Class-based Program Design](https://course.ccs.neu.edu/cs2510sp22/index.html) | 13 weeks | 5-10 hours/week | Systematic Program Design, High School Math | [chat](https://discord.com/channels/744385009028431943/891411727294562314)
+[Programming Languages, Part A](https://www.coursera.org/learn/programming-languages) | 5 weeks | 4-8 hours/week | Systematic Program Design ([Hear instructor](https://www.coursera.org/lecture/programming-languages/recommended-background-k1yuh)) | [chat](https://discord.gg/8BkJtXN)
+[Programming Languages, Part B](https://www.coursera.org/learn/programming-languages-part-b) | 3 weeks | 4-8 hours/week | Programming Languages, Part A | [chat](https://discord.gg/EeA7VR9)
+[Programming Languages, Part C](https://www.coursera.org/learn/programming-languages-part-c) | 3 weeks | 4-8 hours/week | Programming Languages, Part B | [chat](https://discord.gg/8EZUVbA)
+[Object-Oriented Design](https://course.ccs.neu.edu/cs3500f19/) | 13 weeks | 5-10 hours/week | Class Based Program Design | [chat](https://discord.com/channels/744385009028431943/891412022120579103)
+[Software Architecture](https://www.coursera.org/learn/software-architecture) | 4 weeks | 2-5 hours/week | Object Oriented Design | [chat](https://discord.com/channels/744385009028431943/891412169638432788)
+
+### Core math
+Discrete math (Math for CS) is a prerequisite and closely related to the study of algorithms and data structures. Calculus both prepares students for discrete math and helps students develop mathematical maturity.
+
+**Topics covered**:
+`discrete mathematics`
+`mathematical proofs`
+`basic statistics`
+`O-notation`
+`discrete probability`
+`and more`
+
+Courses | Duration | Effort | Notes | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--: | :--:
+[Calculus 1A: Differentiation](https://openlearninglibrary.mit.edu/courses/course-v1:MITx+18.01.1x+2T2019/about) ([alternative](https://ocw.mit.edu/courses/mathematics/18-01sc-single-variable-calculus-fall-2010/index.htm)) | 13 weeks | 6-10 hours/week | The alternate covers this and the following 2 courses | [high school math](https://ossu.dev/precollege-math) | [chat](https://discord.gg/mPCt45F)
+[Calculus 1B: Integration](https://openlearninglibrary.mit.edu/courses/course-v1:MITx+18.01.2x+3T2019/about) | 13 weeks | 5-10 hours/week | - | Calculus 1A | [chat](https://discord.gg/sddAsZg)
+[Calculus 1C: Coordinate Systems & Infinite Series](https://openlearninglibrary.mit.edu/courses/course-v1:MITx+18.01.3x+1T2020/about) | 6 weeks | 5-10 hours/week | - | Calculus 1B | [chat](https://discord.gg/FNEcNNq)
+[Mathematics for Computer Science](https://openlearninglibrary.mit.edu/courses/course-v1:OCW+6.042J+2T2019/about) ([alternative](https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/)) | 13 weeks | 5 hours/week | [2015/2019 solutions](https://github.com/spamegg1/Math-for-CS-solutions) [2010 solutions](https://github.com/frevib/mit-cs-math-6042-fall-2010-problems) [2005 solutions](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2005/assignments/). | Calculus 1C | [chat](https://discord.gg/EuTzNbF)
+
+
+### CS Tools
+Understanding theory is important, but you will also be expected to create programs. There are a number of tools that are widely used to make that process easier. Learn them now to ease your future work writing programs.
+
+**Topics covered**:
+`terminals and shell scripting`
+`vim`
+`command line environments`
+`version control`
+`and more`
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[The Missing Semester of Your CS Education](https://missing.csail.mit.edu/) | 2 weeks | 12 hours/week | - | [chat](https://discord.gg/5FvKycS)
+
+### Core systems
+
+**Topics covered**:
+`procedural programming`
+`manual memory management`
+`boolean algebra`
+`gate logic`
+`memory`
+`computer architecture`
+`assembly`
+`machine language`
+`virtual machines`
+`high-level languages`
+`compilers`
+`operating systems`
+`network protocols`
+`and more`
+
+Courses | Duration | Effort | Additional Text / Assignments| Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--: | :--:
+[Build a Modern Computer from First Principles: From Nand to Tetris](https://www.coursera.org/learn/build-a-computer) ([alternative](https://www.nand2tetris.org/)) | 6 weeks | 7-13 hours/week | - | C-like programming language | [chat](https://discord.gg/vxB2DRV)
+[Build a Modern Computer from First Principles: Nand to Tetris Part II ](https://www.coursera.org/learn/nand2tetris2) | 6 weeks | 12-18 hours/week | - | one of [these programming languages](https://user-images.githubusercontent.com/2046800/35426340-f6ce6358-026a-11e8-8bbb-4e95ac36b1d7.png), From Nand to Tetris Part I | [chat](https://discord.gg/AsUXcPu)
+[Operating Systems: Three Easy Pieces](coursepages/ostep/README.md) | 10-12 weeks | 6-10 hours/week | - | Nand to Tetris Part II | [chat](https://discord.gg/wZNgpep)
+[Computer Networking: a Top-Down Approach](http://gaia.cs.umass.edu/kurose_ross/online_lectures.htm)| 8 weeks | 4–12 hours/week | [Wireshark Labs](http://gaia.cs.umass.edu/kurose_ross/wireshark.php) | algebra, probability, basic CS | [chat](https://discord.gg/MJ9YXyV)
+
+### Core theory
+
+**Topics covered**:
+`divide and conquer`
+`sorting and searching`
+`randomized algorithms`
+`graph search`
+`shortest paths`
+`data structures`
+`greedy algorithms`
+`minimum spanning trees`
+`dynamic programming`
+`NP-completeness`
+`and more`
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[Divide and Conquer, Sorting and Searching, and Randomized Algorithms](https://www.coursera.org/learn/algorithms-divide-conquer) | 4 weeks | 4-8 hours/week | any programming language, Mathematics for Computer Science | [chat](https://discord.gg/mKRS7tY)
+[Graph Search, Shortest Paths, and Data Structures](https://www.coursera.org/learn/algorithms-graphs-data-structures) | 4 weeks | 4-8 hours/week | Divide and Conquer, Sorting and Searching, and Randomized Algorithms | [chat](https://discord.gg/Qstqe4t)
+[Greedy Algorithms, Minimum Spanning Trees, and Dynamic Programming](https://www.coursera.org/learn/algorithms-greedy) | 4 weeks | 4-8 hours/week | Graph Search, Shortest Paths, and Data Structures | [chat](https://discord.gg/dWVvjuz)
+[Shortest Paths Revisited, NP-Complete Problems and What To Do About Them](https://www.coursera.org/learn/algorithms-npcomplete) | 4 weeks | 4-8 hours/week | Greedy Algorithms, Minimum Spanning Trees, and Dynamic Programming | [chat](https://discord.gg/dYuY78u)
+
+### Core security
+**Topics covered**
+`Confidentiality, Integrity, Availability`
+`Secure Design`
+`Defensive Programming`
+`Threats and Attacks`
+`Network Security`
+`Cryptography`
+`and more`
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[Cybersecurity Fundamentals](https://www.edx.org/course/cybersecurity-fundamentals) | 8 weeks | 10-12 hours/week | - | [chat](https://discord.gg/XdY3AwTFK4)
+[Principles of Secure Coding](https://www.coursera.org/learn/secure-coding-principles)| 4 weeks | 4 hours/week | - | [chat](https://discord.gg/5gMdeSK)
+[Identifying Security Vulnerabilities](https://www.coursera.org/learn/identifying-security-vulnerabilities) | 4 weeks | 4 hours/week | - | [chat](https://discord.gg/V78MjUS)
+
+Choose **one** of the following:
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[Identifying Security Vulnerabilities in C/C++Programming](https://www.coursera.org/learn/identifying-security-vulnerabilities-c-programming) | 4 weeks | 5 hours/week | - | [chat](https://discord.gg/Vbxce7A)
+[Exploiting and Securing Vulnerabilities in Java Applications](https://www.coursera.org/learn/exploiting-securing-vulnerabilities-java-applications) | 4 weeks | 5 hours/week | - | [chat](https://discord.gg/QxC22rR)
+
+### Core applications
+
+**Topics covered**:
+`Agile methodology`
+`REST`
+`software specifications`
+`refactoring`
+`relational databases`
+`transaction processing`
+`data modeling`
+`neural networks`
+`supervised learning`
+`unsupervised learning`
+`OpenGL`
+`ray tracing`
+`and more`
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[Databases: Modeling and Theory](https://www.edx.org/course/modeling-and-theory)| 2 weeks | 10 hours/week | core programming | [chat](https://discord.gg/pMFqNf4)
+[Databases: Relational Databases and SQL](https://www.edx.org/course/databases-5-sql)| 2 weeks | 10 hours/week | core programming | [chat](https://discord.gg/P8SPPyF)
+[Databases: Semistructured Data](https://www.edx.org/course/semistructured-data)| 2 weeks | 10 hours/week | core programming | [chat](https://discord.gg/duCJ3GN)
+[Machine Learning](https://www.coursera.org/specializations/machine-learning-introduction)| 11 weeks | 9 hours/week | Basic coding | [chat](https://discord.gg/NcXHDjy)
+[Computer Graphics](https://www.edx.org/course/computer-graphics-2) ([alternative](https://cseweb.ucsd.edu/~viscomp/classes/cse167/wi22/schedule.html))| 6 weeks | 12 hours/week | C++ or Java, [Basic Linear Algebra](https://ossu.dev/precollege-math/coursepages/precalculus) | [chat](https://discord.gg/68WqMNV)
+[Software Engineering: Introduction](https://www.edx.org/learn/software-engineering/university-of-british-columbia-software-engineering-introduction) ([alternative](https://github.com/ubccpsc/310/blob/main/resources/README.md)) | 6 weeks | 8-10 hours/week | Core Programming, and a [sizable project](FAQ.md#why-require-experience-with-a-sizable-project-before-the-Software-Engineering-courses) | [chat](https://discord.gg/5Qtcwtz)
+
+### Core ethics
+
+**Topics covered**:
+`Social Context`
+`Analytical Tools`
+`Professional Ethics`
+`Intellectual Property`
+`Privacy and Civil Liberties`
+`and more`
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[Ethics, Technology and Engineering](https://www.coursera.org/learn/ethics-technology-engineering)| 9 weeks | 2 hours/week | none | [chat](https://discord.gg/6ttjPmzZbe)
+[Introduction to Intellectual Property](https://www.coursera.org/learn/introduction-intellectual-property)| 4 weeks | 2 hours/week | none | [chat](https://discord.gg/YbuERswpAK)
+[Data Privacy Fundamentals](https://www.coursera.org/learn/northeastern-data-privacy)| 3 weeks | 3 hours/week | none | [chat](https://discord.gg/64J34ajNBd)
+
+## Advanced CS
+
+After completing **every required course** in Core CS, students should choose a subset of courses from Advanced CS based on interest.
+Not every course from a subcategory needs to be taken.
+But students should take *every* course that is relevant to the field they intend to go into.
+
+### Advanced programming
+
+**Topics covered**:
+`debugging theory and practice`
+`goal-oriented programming`
+`parallel computing`
+`object-oriented analysis and design`
+`UML`
+`large-scale software architecture and design`
+`and more`
+
+Courses | Duration | Effort | Prerequisites
+:-- | :--: | :--: | :--:
+[Parallel Programming](https://www.coursera.org/learn/scala-parallel-programming)| 4 weeks | 6-8 hours/week | Scala programming
+[Compilers](https://www.edx.org/course/compilers) | 9 weeks | 6-8 hours/week | none
+[Introduction to Haskell](https://www.seas.upenn.edu/~cis194/fall16/)| 14 weeks | - | -
+[Learn Prolog Now!](https://www.let.rug.nl/bos/lpn//lpnpage.php?pageid=online) ([alternative](https://github.com/ossu/computer-science/files/6085884/lpn.pdf))*| 12 weeks | - | -
+[Software Debugging](https://www.youtube.com/playlist?list=PLAwxTw4SYaPkxK63TiT88oEe-AIBhr96A)| 8 weeks | 6 hours/week | Python, object-oriented programming
+[Software Testing](https://www.youtube.com/playlist?list=PLAwxTw4SYaPkWVHeC_8aSIbSxE_NXI76g) | 4 weeks | 6 hours/week | Python, programming experience
+
+(*) book by Blackburn, Bos, Striegnitz (compiled from [source](https://github.com/LearnPrologNow/lpn), redistributed under [CC license](https://creativecommons.org/licenses/by-sa/4.0/))
+
+### Advanced systems
+
+**Topics covered**:
+`digital signaling`
+`combinational logic`
+`CMOS technologies`
+`sequential logic`
+`finite state machines`
+`processor instruction sets`
+`caches`
+`pipelining`
+`virtualization`
+`parallel processing`
+`virtual memory`
+`synchronization primitives`
+`system call interface`
+`and more`
+
+Courses | Duration | Effort | Prerequisites | Notes
+:-- | :--: | :--: | :--: | :--:
+[Computation Structures 1: Digital Circuits](https://learning.edx.org/course/course-v1:MITx+6.004.1x_3+3T2016) [alternative 1](https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/) [alternative 2](https://ocw.mit.edu/courses/6-004-computation-structures-spring-2009/) | 10 weeks | 6 hours/week | [Nand2Tetris II](https://www.coursera.org/learn/nand2tetris2) | Alternate links contain all 3 courses.
+[Computation Structures 2: Computer Architecture](https://learning.edx.org/course/course-v1:MITx+6.004.2x+3T2015) | 10 weeks | 6 hours/week | Computation Structures 1 | -
+[Computation Structures 3: Computer Organization](https://learning.edx.org/course/course-v1:MITx+6.004.3x_2+1T2017) | 10 weeks | 6 hours/week | Computation Structures 2 | -
+
+### Advanced theory
+
+**Topics covered**:
+`formal languages`
+`Turing machines`
+`computability`
+`event-driven concurrency`
+`automata`
+`distributed shared memory`
+`consensus algorithms`
+`state machine replication`
+`computational geometry theory`
+`propositional logic`
+`relational logic`
+`Herbrand logic`
+`game trees`
+`and more`
+
+Courses | Duration | Effort | Prerequisites
+:-- | :--: | :--: | :--:
+[Theory of Computation](https://ocw.mit.edu/courses/18-404j-theory-of-computation-fall-2020/) ([alternative](https://www.youtube.com/playlist?list=PLEE7DF8F5E0203A56)) | 13 weeks | 10 hours/week | [Mathematics for Computer Science](https://openlearninglibrary.mit.edu/courses/course-v1:OCW+6.042J+2T2019/about), logic, algorithms
+[Computational Geometry](https://www.edx.org/course/computational-geometry) | 16 weeks | 8 hours/week | algorithms, C++
+[Game Theory](https://www.coursera.org/learn/game-theory-1) | 8 weeks | 3 hours/week | mathematical thinking, probability, calculus
+
+### Advanced Information Security
+
+Courses | Duration | Effort | Prerequisites
+:-- | :--: | :--: | :--:
+[Web Security Fundamentals](https://www.edx.org/course/web-security-fundamentals) | 5 weeks | 4-6 hours/week | understanding basic web technologies
+[Security Governance & Compliance](https://www.coursera.org/learn/security-governance-compliance) | 3 weeks | 3 hours/week | -
+[Digital Forensics Concepts](https://www.coursera.org/learn/digital-forensics-concepts) | 3 weeks | 2-3 hours/week | Core Security
+[Secure Software Development: Requirements, Design, and Reuse](https://www.edx.org/course/secure-software-development-requirements-design-and-reuse) | 7 weeks | 1-2 hours/week | Core Programming and Core Security
+[Secure Software Development: Implementation](https://www.edx.org/course/secure-software-development-implementation) | 7 weeks | 1-2 hours/week | Secure Software Development: Requirements, Design, and Reuse
+[Secure Software Development: Verification and More Specialized Topics](https://www.edx.org/course/secure-software-development-verification-and-more-specialized-topics) | 7 weeks | 1-2 hours/week | Secure Software Development: Implementation
+
+### Advanced math
+
+Courses | Duration | Effort | Prerequisites | Discussion
+:-- | :--: | :--: | :--: | :--:
+[Essence of Linear Algebra](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) | - | - | [high school math](https://ossu.dev/precollege-math) | [chat](https://discord.gg/m6wHbP6)
+[Linear Algebra](https://ocw.mit.edu/courses/mathematics/18-06sc-linear-algebra-fall-2011/) | 14 weeks | 12 hours/week | corequisite: Essence of Linear Algebra | [chat](https://discord.gg/k7nSWJH)
+[Introduction to Numerical Methods](https://ocw.mit.edu/courses/mathematics/18-335j-introduction-to-numerical-methods-spring-2019/index.htm)| 14 weeks | 12 hours/week | [Linear Algebra](https://ocw.mit.edu/courses/mathematics/18-06sc-linear-algebra-fall-2011/) | [chat](https://discord.gg/FNEcNNq)
+[Introduction to Formal Logic](https://forallx.openlogicproject.org/) | 10 weeks | 4-8 hours/week | [Set Theory](https://www.youtube.com/playlist?list=PL5KkMZvBpo5AH_5GpxMiryJT6Dkj32H6N) | [chat](https://discord.gg/MbM2Gg5)
+[Probability](https://projects.iq.harvard.edu/stat110/home) | 15 weeks | 5-10 hours/week | [Differentiation and Integration](https://www.edx.org/course/calculus-1b-integration) | [chat](https://discord.gg/UVjs9BU)
+
+## Final project
+
+Part of learning is doing.
+The assignments and exams for each course are to prepare you to use your knowledge to solve real-world problems.
+
+After you've completed Core CS and the parts of Advanced CS relevant to you,
+you should identify a problem that you can solve using the knowledge you've acquired.
+You can create something entirely new, or you can improve some tool/program that you use and wish were better.
+
+Students who would like more guidance in creating a project may choose to use a series of project oriented courses.
+Here is a sample of options
+(many more are available, at this point you should be capable of identifying a series that is interesting and relevant to you):
+
+Courses | Duration | Effort | Prerequisites
+:-- | :--: | :--: | :--:
+[Fullstack Open](https://fullstackopen.com/en/) | 12 weeks | 15 hours/week | programming
+[Modern Robotics (Specialization)](https://www.coursera.org/specializations/modernrobotics) | 26 weeks | 2-5 hours/week | freshman-level physics, linear algebra, calculus, [linear ordinary differential equations](https://www.khanacademy.org/math/differential-equations)
+[Data Mining (Specialization)](https://www.coursera.org/specializations/data-mining) | 30 weeks | 2-5 hours/week | machine learning
+[Big Data (Specialization)](https://www.coursera.org/specializations/big-data) | 30 weeks | 3-5 hours/week | none
+[Internet of Things (Specialization)](https://www.coursera.org/specializations/internet-of-things) | 30 weeks | 1-5 hours/week | strong programming
+[Cloud Computing (Specialization)](https://www.coursera.org/specializations/cloud-computing) | 30 weeks | 2-6 hours/week | C++ programming
+[Data Science (Specialization)](https://www.coursera.org/specializations/jhu-data-science) | 43 weeks | 1-6 hours/week | none
+[Functional Programming in Scala (Specialization)](https://www.coursera.org/specializations/scala) | 29 weeks | 4-5 hours/week | One year programming experience
+[Game Design and Development with Unity 2020 (Specialization)](https://www.coursera.org/specializations/game-design-and-development) | 6 months | 5 hours/week | programming, interactive design
+
+## Congratulations
+
+After completing the requirements of the curriculum above,
+you will have completed the equivalent of a full bachelor's degree in Computer Science.
+Congratulations!
+
+What is next for you? The possibilities are boundless and overlapping:
+
+- Look for a job as a developer!
+- Check out the [readings](extras/readings.md) for classic books you can read that will sharpen your skills and expand your knowledge.
+- Join a local developer meetup (e.g. via [meetup.com](https://www.meetup.com/)).
+- Pay attention to emerging technologies in the world of software development:
+ + Explore the **actor model** through [Elixir](https://elixir-lang.org/), a new functional programming language for the web based on the battle-tested Erlang Virtual Machine!
+ + Explore **borrowing and lifetimes** through [Rust](https://www.rust-lang.org/), a systems language which achieves memory- and thread-safety without a garbage collector!
+ + Explore **dependent type systems** through [Idris](https://www.idris-lang.org/), a new Haskell-inspired language with unprecedented support for type-driven development.
+
+
+
+# Code of conduct
+[OSSU's code of conduct](https://github.com/ossu/code-of-conduct).
+
+## How to show your progress
+
+[Fork](https://www.freecodecamp.org/news/how-to-fork-a-github-repository/) the [GitHub repo](https://github.com/ossu/computer-science) into your own GitHub account and put ✅ next to the stuff you've completed as you complete it. This can serve as your [kanban board](https://en.wikipedia.org/wiki/Kanban_board) and will be faster to implement than any other solution (giving you time to spend on the courses).
+
+# Team
+
+* **[Eric Douglas](https://github.com/ericdouglas)**: founder of OSSU
+* **[Josh Hanson](https://github.com/joshmhanson)**: lead technical maintainer
+* **[Waciuma Wanjohi](https://github.com/waciumawanjohi)**: lead academic maintainer
+* **[Contributors](https://github.com/ossu/computer-science/graphs/contributors)**
diff --git a/_config.yml b/_config.yml
new file mode 100644
index 000000000..958199ef9
--- /dev/null
+++ b/_config.yml
@@ -0,0 +1,8 @@
+title: Computer Science
+remote_theme: "jekyll/minima@7d91bb5"
+minima:
+ skin: auto
+ nav_pages:
+ - FAQ.md
+ - HELP.md
+include: ['CONTRIBUTING.md']
diff --git a/_includes/custom-head.html b/_includes/custom-head.html
new file mode 100644
index 000000000..5081f570f
--- /dev/null
+++ b/_includes/custom-head.html
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/_includes/footer.html b/_includes/footer.html
new file mode 100644
index 000000000..01b2469fc
--- /dev/null
+++ b/_includes/footer.html
@@ -0,0 +1,17 @@
+
diff --git a/_includes/nav-items.html b/_includes/nav-items.html
new file mode 100644
index 000000000..677373ff1
--- /dev/null
+++ b/_includes/nav-items.html
@@ -0,0 +1,7 @@
+{%- for path in include.paths -%}
+ {%- assign hyperpage = site.pages | where: "path", path | first -%}
+ {%- if hyperpage.title %}
+ {{ hyperpage.title | escape }}
+ {%- endif -%}
+{%- endfor -%}
+GitHub
diff --git a/_layouts/page.html b/_layouts/page.html
new file mode 100644
index 000000000..43851a089
--- /dev/null
+++ b/_layouts/page.html
@@ -0,0 +1,10 @@
+---
+layout: base
+---
+
+
+
+ {{ content }}
+
+
+
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/README.md b/computer-science/01-introduction-to-cs-and-programming-mit/README.md
deleted file mode 100644
index 50508f6b0..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# [Introduction to Computer Science and Programming](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/)
-
-## Unit 1
-
-- INTRODUCTION TO 6.00 ✔
-- CORE ELEMENTS OF A PROGRAM ✔
-- PROBLEM SOLVING ✍
-- MACHINE INTERPRETATION OF A PROGRAM
-- OBJECTS IN PYTHON
-- RECURSION
-- DEBUGGING
-- EFFICIENCY AND ORDER OF GROWTH
-- MEMORY AND SEARCH METHODS
-- QUIZ 1
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/00-problem-set.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/00-problem-set.js
deleted file mode 100644
index a530156fa..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/00-problem-set.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-
- Write a program that does the following in order:
-
- 1. Asks the user to enter his/her date of birth.
- 2. Asks the user to enter his/her last name.
- 3. Prints out the user’s last name and date of birth, in that order.
-
-*/
-
-var answers = 0;
-var birthDate = '';
-var lastName = '';
-
-process.stdin.resume();
-
-console.log( 'What is your birth date?' );
-process.stdin.setEncoding( 'utf8' );
-
-process.stdin.on( 'data', function( input ) {
-
- if ( answers === 0 ) {
-
- birthDate = input;
- answers += 1;
-
- console.log( 'What is your last name?' );
-
- } else if ( answers === 1 ) {
-
- lastName = input;
-
- console.log(
- '================\n<< Informations >>\n' +
- 'Birth date: ' + birthDate + '\n' +
- 'Last Name: ' + lastName + '\n' +
- 'Bye!'
- );
-
- process.exit();
-
- }
-
-});
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/02-lecture.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/02-lecture.js
deleted file mode 100644
index f837cf284..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/02-lecture.js
+++ /dev/null
@@ -1,126 +0,0 @@
-// Modules
-var prompt = require( 'prompt' );
-
-// // Create a variable x and assign value 3 to it
-// var x = 3;
-
-// // Bind x to value 9
-// x *= x; // or x = x * x;
-// console.log( x );
-
-// // read input data from terminal
-// prompt.start();
-// prompt.get({
-// name : 'number',
-// description : 'Enter a number'
-// }, function( err, results ) {
-
-// console.log( results.number );
-
-// });
-
-// // Verify if a integer number is even or odd.
-// // If odd, verify if the number is divisible by 3
-// // read input data from terminal
-// prompt.start();
-
-// prompt.get([
-// {
-// name : 'number',
-// description : 'Enter a integer'
-// }
-// ], function( err, results ) {
-
-// var int = parseInt( results.number, 10 );
-
-// if ( int % 2 === 0 ) {
-
-// console.log( int + ' is EVEN' );
-
-// } else {
-
-// var msg = int.toString() + ' is ODD';
-
-// if ( int % 3 !== 0 ) {
-
-// msg += ' and NOT divisible by 3';
-
-// }
-
-// console.log( msg );
-
-// }
-
-// });
-
-// // Find the lowest among three numbers
-// prompt.start();
-// prompt.get([
-// {
-// name : 'x',
-// description : 'Enter x'
-// },
-// {
-// name : 'y',
-// description : 'Enter y'
-// },
-// {
-// name : 'z',
-// description : 'Enter z'
-// }
-// ], function( err, results ) {
-
-// if ( results.x < results.y ) {
-
-// if ( results.x < results.z ) {
-// console.log( 'x is least' );
-// } else {
-// console.log( 'z is least' );
-// }
-
-// } else if ( results.y < results.z ) {
-
-// console.log( 'y is least' );
-
-// } else {
-
-// console.log( 'z is least' );
-
-// }
-
-// });
-
-// Find the cube root of a perfect cube
-prompt.start();
-prompt.get([
- {
- name : 'x',
- description : 'Enter a interger'
- }
-], function( err, results ) {
-
- var x = parseInt( results.x, 10 );
- var ans = 0;
-
- while ( Math.pow( ans, 3 ) < Math.abs( x )) {
-
- ans += 1;
- console.log( 'Current guess:', ans );
-
- }
-
- if ( Math.pow( ans, 3 ) !== Math.abs( x )) {
-
- console.log( x, 'is not a perfect cube' );
-
- } else {
-
- if ( x < 0 ) {
- ans = -ans;
- }
-
- console.log( 'Cube root of ' + x.toString() + ' is ' + ans.toString());
-
- }
-
-});
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/03-lecture.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/03-lecture.js
deleted file mode 100644
index b0b4d8365..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/03-lecture.js
+++ /dev/null
@@ -1,91 +0,0 @@
-// Modules
-var range = require( 'range' ).range;
-var prompt = require( 'prompt' );
-
-// // Find the cube root of a perfect cube
-// prompt.start();
-// prompt.get([
-// {
-// name : 'x',
-// description : 'Enter a interger'
-// }
-// ], function( err, results ) {
-
-// var x = parseInt( results.x, 10 );
-// var ans = 0;
-
-// while ( Math.pow( ans, 3 ) < Math.abs( x )) {
-
-// ans += 1;
-// console.log( 'Current guess:', ans );
-
-// }
-
-// if ( Math.pow( ans, 3 ) !== Math.abs( x )) {
-
-// console.log( x, 'is not a perfect cube' );
-
-// } else {
-
-// if ( x < 0 ) {
-// ans = -ans;
-// }
-
-// console.log( 'Cube root of ' + x.toString() + ' is ' + ans.toString());
-
-// }
-
-// });
-
-// // Find the cube root of a perfect cube
-// prompt.start();
-// prompt.get([
-// {
-// name : 'x',
-// description : 'Enter a interger'
-// }
-// ], function( err, results ) {
-
-// var x = parseInt( results.x, 10 );
-// var ans;
-
-// for ( ans in range( 0, Math.abs( x ) + 1 )) {
-
-// if ( Math.pow( ans, 3 ) === Math.abs( x )) {
-// break;
-// }
-
-// }
-
-// if ( Math.pow( ans, 3 ) !== Math.abs( x )) {
-
-// console.log( x + ' is not a perfect cube' );
-
-// } else {
-
-// console.log( 'Cube root of ' + x.toString() + ' is ' + ans.toString());
-
-// }
-
-// });
-
-// Find closest number to be a square root of another number
-var x = 25;
-var epsilon = 0.01;
-var numGuesses = 0;
-var ans = 0;
-
-while ( Math.abs( Math.pow( ans, 2 ) - x ) >= epsilon && ans <= x ) {
-
- ans += 0.00001;
- numGuesses += 1;
-
-}
-
-console.log( 'numGuesses: ' + numGuesses );
-
-if ( Math.abs( Math.pow( ans, 2 ) - x >= epsilon )) {
- console.log( 'Failed on square root of ' + x.toString());
-} else {
- console.log( ans.toString() + ' is close to square root of ' + x.toString());
-}
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.jshintrc b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.jshintrc
deleted file mode 100644
index 0d9798654..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.jshintrc
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "passfail": false,
- "maxerr": 100,
-
- "browser": false,
- "node": true,
- "rhino": false,
- "couch": true,
- "wsh": true,
- "jquery": true,
- "prototypejs": false,
- "mootools": false,
- "dojo": false,
-
- "devel": false,
-
- "es5": true,
- "strict": false,
- "globalstrict": false,
-
- "asi": false,
- "lastsemic": true,
- "laxbreak": true,
- "laxcomma": false,
- "bitwise": false,
- "boss": false,
- "curly": true,
- "eqeqeq": true,
- "eqnull": false,
- "evil": false,
- "expr": false,
- "forin": false,
- "immed": false,
- "latedef": false,
- "loopfunc": true,
- "noarg": true,
- "regexp": true,
- "regexdash": false,
- "scripturl": true,
- "shadow": true,
- "supernew": true,
- "undef": true,
-
- "newcap": true,
- "noempty": true,
- "nonew": true,
- "nomen": false,
- "onevar": true,
- "plusplus": false,
- "sub": true,
- "trailing": true,
- "white": false,
- "indent": 2
-}
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.npmignore b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.npmignore
deleted file mode 100644
index e3bc27506..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-node_modules/
-node_modules/*
-npm-debug.log
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.travis.yml b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.travis.yml
deleted file mode 100644
index b6a50e4cb..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-language: node_js
-node_js:
- - 0.8
- - 0.10
-
-notifications:
- email:
- - travis@nodejitsu.com
- irc: "irc.freenode.org#nodejitsu"
-
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/CHANGELOG.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/CHANGELOG.md
deleted file mode 100644
index b094c4893..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/CHANGELOG.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-0.2.7 / 2012-08-30
-==================
-
- * Fixed handling of numeric inputs with parseFloat
- * Fixed overwriting of non-string inputs
- * Added support for boolean types
-
-0.2.6 / 2012-08-12
-==================
-
- * Added allowance of empty default values
-
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/LICENSE b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/LICENSE
deleted file mode 100644
index 56217cac7..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2010 Nodejitsu Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/README.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/README.md
deleted file mode 100644
index 795bf42de..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/README.md
+++ /dev/null
@@ -1,317 +0,0 @@
-# prompt [](http://travis-ci.org/flatiron/prompt)
-
-A beautiful command-line prompt for node.js
-
-## Features
-
-* prompts the user for input
-* supports validation and defaults
-* hides passwords
-
-## Usage
-Using prompt is relatively straight forward. There are two core methods you should be aware of: `prompt.get()` and `prompt.addProperties()`. There methods take strings representing property names in addition to objects for complex property validation (and more). There are a number of [examples][0] that you should examine for detailed usage.
-
-### Getting Basic Prompt Information
-Getting started with `prompt` is easy. Lets take a look at `examples/simple-prompt.js`:
-
-``` js
- var prompt = require('prompt');
-
- //
- // Start the prompt
- //
- prompt.start();
-
- //
- // Get two properties from the user: username and email
- //
- prompt.get(['username', 'email'], function (err, result) {
- //
- // Log the results.
- //
- console.log('Command-line input received:');
- console.log(' username: ' + result.username);
- console.log(' email: ' + result.email);
- });
-```
-
-This will result in the following command-line output:
-
-```
- $ node examples/simple-prompt.js
- prompt: username: some-user
- prompt: email: some-user@some-place.org
- Command-line input received:
- username: some-user
- email: some-user@some-place.org
-```
-
-### Prompting with Validation, Default Values, and More (Complex Properties)
-In addition to prompting the user with simple string prompts, there is a robust API for getting and validating complex information from a command-line prompt. Here's a quick sample:
-
-``` js
- var schema = {
- properties: {
- name: {
- pattern: /^[a-zA-Z\s\-]+$/,
- message: 'Name must be only letters, spaces, or dashes',
- required: true
- },
- password: {
- hidden: true
- }
- }
- };
-
- //
- // Start the prompt
- //
- prompt.start();
-
- //
- // Get two properties from the user: email, password
- //
- prompt.get(schema, function (err, result) {
- //
- // Log the results.
- //
- console.log('Command-line input received:');
- console.log(' name: ' + result.name);
- console.log(' password: ' + result.password);
- });
-```
-
-Pretty easy right? The output from the above script is:
-
-```
- $ node examples/property-prompt.js
- prompt: name: nodejitsu000
- error: Invalid input for name
- error: Name must be only letters, spaces, or dashes
- prompt: name: Nodejitsu Inc
- prompt: password:
- Command-line input received:
- name: Nodejitsu Inc
- password: some-password
-```
-
-## Valid Property Settings
-`prompt` understands JSON-schema with a few extra parameters and uses [revalidator](https://github.com/flatiron/revalidator) for validation.
-
-Here's an overview of the properties that may be used for validation and prompting controls:
-
-``` js
- {
- description: 'Enter your password', // Prompt displayed to the user. If not supplied name will be used.
- type: 'string', // Specify the type of input to expect.
- pattern: /^\w+$/, // Regular expression that input must be valid against.
- message: 'Password must be letters', // Warning message to display if validation fails.
- hidden: true, // If true, characters entered will not be output to console.
- default: 'lamepassword', // Default value to use if no value is entered.
- required: true // If true, value entered must be non-empty.
- before: function(value) { return 'v' + value; } // Runs before node-prompt callbacks. It modifies user's input
- }
-```
-
-Alternatives to `pattern` include `format` and `conform`, as documented in [revalidator](https://github.com/flatiron/revalidator).
-
-Using `type: 'array'` has some special cases.
-
-- `description` will not work in the schema if `type: 'array'` is defined.
-- `maxItems` takes precedence over `minItems`.
-- Arrays that do not have `maxItems` defined will require users to `SIGINT` (`^C`) before the array is ended.
-- If `SIGINT` (`^C`) is triggered before `minItems` is met, a validation error will appear. This will require users to `SIGEOF` (`^D`) to end the input.
-
-For more information on things such as `maxItems` and `minItems`, refer to the [revalidator](https://github.com/flatiron/revalidator) repository.
-
-### Alternate Validation API:
-
-Prompt, in addition to iterating over JSON-Schema properties, will also happily iterate over an array of validation objects given an extra 'name' property:
-
-```js
- var prompt = require('../lib/prompt');
-
- //
- // Start the prompt
- //
- prompt.start();
-
- //
- // Get two properties from the user: username and password
- //
- prompt.get([{
- name: 'username',
- required: true
- }, {
- name: 'password',
- hidden: true,
- conform: function (value) {
- return true;
- }
- }], function (err, result) {
- //
- // Log the results.
- //
- console.log('Command-line input received:');
- console.log(' username: ' + result.username);
- console.log(' password: ' + result.password);
- });
-```
-
-### Backward Compatibility
-
-Note that, while this structure is similar to that used by prompt 0.1.x, that the object properties use the same names as in JSON-Schema. prompt 0.2.x is backward compatible with prompt 0.1.x except for asynchronous validation.
-
-### Skipping Prompts
-
-Sometimes power users may wish to skip promts and specify all data as command line options.
-if a value is set as a property of `prompt.override` prompt will use that instead of
-prompting the user.
-
-``` js
- //prompt-override.js
-
- var prompt = require('prompt'),
- optimist = require('optimist')
-
- //
- // set the overrides
- //
- prompt.override = optimist.argv
-
- //
- // Start the prompt
- //
- prompt.start();
-
- //
- // Get two properties from the user: username and email
- //
- prompt.get(['username', 'email'], function (err, result) {
- //
- // Log the results.
- //
- console.log('Command-line input received:');
- console.log(' username: ' + result.username);
- console.log(' email: ' + result.email);
- })
-
- //: node prompt-override.js --username USER --email EMAIL
-```
-
-
-### Adding Properties to an Object
-A common use-case for prompting users for data from the command-line is to extend or create a configuration object that is passed onto the entry-point method for your CLI tool. `prompt` exposes a convenience method for doing just this:
-
-``` js
- var obj = {
- password: 'lamepassword',
- mindset: 'NY'
- }
-
- //
- // Log the initial object.
- //
- console.log('Initial object to be extended:');
- console.dir(obj);
-
- //
- // Add two properties to the empty object: username and email
- //
- prompt.addProperties(obj, ['username', 'email'], function (err) {
- //
- // Log the results.
- //
- console.log('Updated object received:');
- console.dir(obj);
- });
-```
-
-### Prompt history
-You can use the `prompt.history()` method to get access to previous prompt input.
-
-``` js
- prompt.get([{
- name: 'name',
- description: 'Your name',
- type: 'string',
- required: true
- }, {
- name: 'surname',
- description: 'Your surname',
- type: 'string',
- required: true,
- message: 'Please dont use the demo credentials',
- conform: function(surname) {
- var name = prompt.history('name').value;
- return (name !== 'John' || surname !== 'Smith');
- }
- }], function(err, results) {
- console.log(results);
- });
-```
-
-## Customizing your prompt
-Aside from changing `property.message`, you can also change `prompt.message`
-and `prompt.delimiter` to change the appearance of your prompt.
-
-The basic structure of a prompt is this:
-
-``` js
-prompt.message + prompt.delimiter + property.message + prompt.delimiter;
-```
-
-The default `prompt.message` is "prompt," the default `prompt.delimiter` is
-": ", and the default `property.message` is `property.name`.
-Changing these allows you to customize the appearance of your prompts! In
-addition, prompt supports ANSI color codes via the
-[colors module](https://github.com/Marak/colors.js) for custom colors. For a
-very colorful example:
-
-``` js
- var prompt = require("prompt");
-
- //
- // Setting these properties customizes the prompt.
- //
- prompt.message = "Question!".rainbow;
- prompt.delimiter = "><".green;
-
- prompt.start();
-
- prompt.get({
- properties: {
- name: {
- description: "What is your name?".magenta
- }
- }
- }, function (err, result) {
- console.log("You said your name is: ".cyan + result.name.cyan);
- });
-```
-
-If you don't want colors, you can set
-
-```js
-var prompt = require('prompt');
-
-prompt.colors = false;
-```
-
-## Installation
-
-``` bash
- $ [sudo] npm install prompt
-```
-
-## Running tests
-
-``` bash
- $ npm test
-```
-
-#### License: MIT
-#### Author: [Charlie Robbins](http://github.com/indexzero)
-#### Contributors: [Josh Holbrook](http://github.com/jesusabdullah), [Pavan Kumar Sunkara](http://github.com/pksunkara)
-
-[0]: https://github.com/flatiron/prompt/tree/master/examples
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/docs/docco.css b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/docs/docco.css
deleted file mode 100644
index bd5413433..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/docs/docco.css
+++ /dev/null
@@ -1,194 +0,0 @@
-/*--------------------- Layout and Typography ----------------------------*/
-body {
- font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
- font-size: 15px;
- line-height: 22px;
- color: #252519;
- margin: 0; padding: 0;
-}
-a {
- color: #261a3b;
-}
- a:visited {
- color: #261a3b;
- }
-p {
- margin: 0 0 15px 0;
-}
-h4, h5, h6 {
- color: #333;
- margin: 6px 0 6px 0;
- font-size: 13px;
-}
- h2, h3 {
- margin-bottom: 0;
- color: #000;
- }
- h1 {
- margin-top: 40px;
- margin-bottom: 15px;
- color: #000;
- }
-#container {
- position: relative;
-}
-#background {
- position: fixed;
- top: 0; left: 525px; right: 0; bottom: 0;
- background: #f5f5ff;
- border-left: 1px solid #e5e5ee;
- z-index: -1;
-}
-#jump_to, #jump_page {
- background: white;
- -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
- -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
- font: 10px Arial;
- text-transform: uppercase;
- cursor: pointer;
- text-align: right;
-}
-#jump_to, #jump_wrapper {
- position: fixed;
- right: 0; top: 0;
- padding: 5px 10px;
-}
- #jump_wrapper {
- padding: 0;
- display: none;
- }
- #jump_to:hover #jump_wrapper {
- display: block;
- }
- #jump_page {
- padding: 5px 0 3px;
- margin: 0 0 25px 25px;
- }
- #jump_page .source {
- display: block;
- padding: 5px 10px;
- text-decoration: none;
- border-top: 1px solid #eee;
- }
- #jump_page .source:hover {
- background: #f5f5ff;
- }
- #jump_page .source:first-child {
- }
-table td {
- border: 0;
- outline: 0;
-}
- td.docs, th.docs {
- max-width: 450px;
- min-width: 450px;
- min-height: 5px;
- padding: 10px 25px 1px 50px;
- overflow-x: hidden;
- vertical-align: top;
- text-align: left;
- }
- .docs pre {
- margin: 15px 0 15px;
- padding-left: 15px;
- }
- .docs p tt, .docs p code {
- background: #f8f8ff;
- border: 1px solid #dedede;
- font-size: 12px;
- padding: 0 0.2em;
- }
- .pilwrap {
- position: relative;
- }
- .pilcrow {
- font: 12px Arial;
- text-decoration: none;
- color: #454545;
- position: absolute;
- top: 3px; left: -20px;
- padding: 1px 2px;
- opacity: 0;
- -webkit-transition: opacity 0.2s linear;
- }
- td.docs:hover .pilcrow {
- opacity: 1;
- }
- td.code, th.code {
- padding: 14px 15px 16px 25px;
- width: 100%;
- vertical-align: top;
- background: #f5f5ff;
- border-left: 1px solid #e5e5ee;
- }
- pre, tt, code {
- font-size: 12px; line-height: 18px;
- font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
- margin: 0; padding: 0;
- }
-
-
-/*---------------------- Syntax Highlighting -----------------------------*/
-td.linenos { background-color: #f0f0f0; padding-right: 10px; }
-span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
-body .hll { background-color: #ffffcc }
-body .c { color: #408080; font-style: italic } /* Comment */
-body .err { border: 1px solid #FF0000 } /* Error */
-body .k { color: #954121 } /* Keyword */
-body .o { color: #666666 } /* Operator */
-body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
-body .cp { color: #BC7A00 } /* Comment.Preproc */
-body .c1 { color: #408080; font-style: italic } /* Comment.Single */
-body .cs { color: #408080; font-style: italic } /* Comment.Special */
-body .gd { color: #A00000 } /* Generic.Deleted */
-body .ge { font-style: italic } /* Generic.Emph */
-body .gr { color: #FF0000 } /* Generic.Error */
-body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
-body .gi { color: #00A000 } /* Generic.Inserted */
-body .go { color: #808080 } /* Generic.Output */
-body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
-body .gs { font-weight: bold } /* Generic.Strong */
-body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
-body .gt { color: #0040D0 } /* Generic.Traceback */
-body .kc { color: #954121 } /* Keyword.Constant */
-body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
-body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
-body .kp { color: #954121 } /* Keyword.Pseudo */
-body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
-body .kt { color: #B00040 } /* Keyword.Type */
-body .m { color: #666666 } /* Literal.Number */
-body .s { color: #219161 } /* Literal.String */
-body .na { color: #7D9029 } /* Name.Attribute */
-body .nb { color: #954121 } /* Name.Builtin */
-body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
-body .no { color: #880000 } /* Name.Constant */
-body .nd { color: #AA22FF } /* Name.Decorator */
-body .ni { color: #999999; font-weight: bold } /* Name.Entity */
-body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
-body .nf { color: #0000FF } /* Name.Function */
-body .nl { color: #A0A000 } /* Name.Label */
-body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
-body .nt { color: #954121; font-weight: bold } /* Name.Tag */
-body .nv { color: #19469D } /* Name.Variable */
-body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
-body .w { color: #bbbbbb } /* Text.Whitespace */
-body .mf { color: #666666 } /* Literal.Number.Float */
-body .mh { color: #666666 } /* Literal.Number.Hex */
-body .mi { color: #666666 } /* Literal.Number.Integer */
-body .mo { color: #666666 } /* Literal.Number.Oct */
-body .sb { color: #219161 } /* Literal.String.Backtick */
-body .sc { color: #219161 } /* Literal.String.Char */
-body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
-body .s2 { color: #219161 } /* Literal.String.Double */
-body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
-body .sh { color: #219161 } /* Literal.String.Heredoc */
-body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
-body .sx { color: #954121 } /* Literal.String.Other */
-body .sr { color: #BB6688 } /* Literal.String.Regex */
-body .s1 { color: #219161 } /* Literal.String.Single */
-body .ss { color: #19469D } /* Literal.String.Symbol */
-body .bp { color: #954121 } /* Name.Builtin.Pseudo */
-body .vc { color: #19469D } /* Name.Variable.Class */
-body .vg { color: #19469D } /* Name.Variable.Global */
-body .vi { color: #19469D } /* Name.Variable.Instance */
-body .il { color: #666666 } /* Literal.Number.Integer.Long */
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/docs/prompt.html b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/docs/prompt.html
deleted file mode 100644
index 7776f5bc4..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/docs/prompt.html
+++ /dev/null
@@ -1,296 +0,0 @@
- prompt.js
@options {Object} Optional Options to consume by prompt
-
-
Starts the prompt by listening to the appropriate events on options.stdin
-and options.stdout. If no streams are supplied, then process.stdin
-and process.stdout are used, respectively.
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/all-properties.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/all-properties.js
deleted file mode 100644
index fd1d831aa..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/all-properties.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * all-properties.js: Sample of including all properties from a package.json file
- *
- * (C) 2011, Charlie Robbins
- *
- */
-
-var util = require('util'),
- pkginfo = require('../lib/pkginfo')(module);
-
-exports.someFunction = function () {
- console.log('some of your custom logic here');
-};
-
-console.log('Inspecting module:');
-console.dir(module.exports);
-
-console.log('\nAll exports exposed:');
-console.error(Object.keys(module.exports));
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/array-argument.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/array-argument.js
deleted file mode 100644
index b1b684874..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/array-argument.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * array-argument.js: Sample of including specific properties from a package.json file
- * using Array argument syntax.
- *
- * (C) 2011, Charlie Robbins
- *
- */
-
-var util = require('util'),
- pkginfo = require('../lib/pkginfo')(module, ['version', 'author']);
-
-exports.someFunction = function () {
- console.log('some of your custom logic here');
-};
-
-console.log('Inspecting module:');
-console.dir(module.exports);
-
-console.log('\nAll exports exposed:');
-console.error(Object.keys(module.exports));
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/multiple-properties.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/multiple-properties.js
deleted file mode 100644
index b4b5fd617..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/multiple-properties.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * multiple-properties.js: Sample of including multiple properties from a package.json file
- *
- * (C) 2011, Charlie Robbins
- *
- */
-
-var util = require('util'),
- pkginfo = require('../lib/pkginfo')(module, 'version', 'author');
-
-exports.someFunction = function () {
- console.log('some of your custom logic here');
-};
-
-console.log('Inspecting module:');
-console.dir(module.exports);
-
-console.log('\nAll exports exposed:');
-console.error(Object.keys(module.exports));
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/object-argument.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/object-argument.js
deleted file mode 100644
index 28420c854..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/object-argument.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * object-argument.js: Sample of including specific properties from a package.json file
- * using Object argument syntax.
- *
- * (C) 2011, Charlie Robbins
- *
- */
-
-var util = require('util'),
- pkginfo = require('../lib/pkginfo')(module, {
- include: ['version', 'author']
- });
-
-exports.someFunction = function () {
- console.log('some of your custom logic here');
-};
-
-console.log('Inspecting module:');
-console.dir(module.exports);
-
-console.log('\nAll exports exposed:');
-console.error(Object.keys(module.exports));
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/package.json b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/package.json
deleted file mode 100644
index 1f2f01c19..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/package.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "simple-app",
- "description": "A test fixture for pkginfo",
- "version": "0.1.0",
- "author": "Charlie Robbins ",
- "keywords": ["test", "fixture"],
- "main": "./index.js",
- "scripts": { "test": "vows test/*-test.js --spec" },
- "engines": { "node": ">= 0.4.0" }
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/single-property.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/single-property.js
deleted file mode 100644
index 4f445614b..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/single-property.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * single-property.js: Sample of including a single specific properties from a package.json file
- *
- * (C) 2011, Charlie Robbins
- *
- */
-
-var util = require('util'),
- pkginfo = require('../lib/pkginfo')(module, 'version');
-
-exports.someFunction = function () {
- console.log('some of your custom logic here');
-};
-
-console.log('Inspecting module:');
-console.dir(module.exports);
-
-console.log('\nAll exports exposed:');
-console.error(Object.keys(module.exports));
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/subdir/package.json b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/subdir/package.json
deleted file mode 100644
index aa8541022..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/subdir/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "simple-app-subdir",
- "description": "A test fixture for pkginfo",
- "version": "0.1.0",
- "author": "Charlie Robbins ",
- "keywords": ["test", "fixture"],
- "main": "./index.js",
- "scripts": { "test": "vows test/*-test.js --spec" },
- "engines": { "node": ">= 0.4.0" },
- "subdironly": "true"
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/target-dir.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/target-dir.js
deleted file mode 100644
index 88770e6f5..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/examples/target-dir.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * multiple-properties.js: Sample of including multiple properties from a package.json file
- *
- * (C) 2011, Charlie Robbins
- *
- */
-
-var util = require('util'),
- path = require('path'),
- pkginfo = require('../lib/pkginfo')(module, { dir: path.resolve(__dirname, 'subdir' )});
-
-exports.someFunction = function () {
- console.log('some of your custom logic here');
-};
-
-console.log('Inspecting module:');
-console.dir(module.exports);
-
-console.log('\nAll exports exposed:');
-console.error(Object.keys(module.exports));
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/lib/pkginfo.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/lib/pkginfo.js
deleted file mode 100644
index c5dc0203f..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/lib/pkginfo.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * pkginfo.js: Top-level include for the pkginfo module
- *
- * (C) 2011, Charlie Robbins
- *
- */
-
-var fs = require('fs'),
- path = require('path');
-
-//
-// ### function pkginfo ([options, 'property', 'property' ..])
-// #### @pmodule {Module} Parent module to read from.
-// #### @options {Object|Array|string} **Optional** Options used when exposing properties.
-// #### @arguments {string...} **Optional** Specified properties to expose.
-// Exposes properties from the package.json file for the parent module on
-// it's exports. Valid usage:
-//
-// `require('pkginfo')()`
-//
-// `require('pkginfo')('version', 'author');`
-//
-// `require('pkginfo')(['version', 'author']);`
-//
-// `require('pkginfo')({ include: ['version', 'author'] });`
-//
-var pkginfo = module.exports = function (pmodule, options) {
- var args = [].slice.call(arguments, 2).filter(function (arg) {
- return typeof arg === 'string';
- });
-
- //
- // **Parse variable arguments**
- //
- if (Array.isArray(options)) {
- //
- // If the options passed in is an Array assume that
- // it is the Array of properties to expose from the
- // on the package.json file on the parent module.
- //
- options = { include: options };
- }
- else if (typeof options === 'string') {
- //
- // Otherwise if the first argument is a string, then
- // assume that it is the first property to expose from
- // the package.json file on the parent module.
- //
- options = { include: [options] };
- }
-
- //
- // **Setup default options**
- //
- options = options || {};
-
- // ensure that includes have been defined
- options.include = options.include || [];
-
- if (args.length > 0) {
- //
- // If additional string arguments have been passed in
- // then add them to the properties to expose on the
- // parent module.
- //
- options.include = options.include.concat(args);
- }
-
- var pkg = pkginfo.read(pmodule, options.dir).package;
- Object.keys(pkg).forEach(function (key) {
- if (options.include.length > 0 && !~options.include.indexOf(key)) {
- return;
- }
-
- if (!pmodule.exports[key]) {
- pmodule.exports[key] = pkg[key];
- }
- });
-
- return pkginfo;
-};
-
-//
-// ### function find (dir)
-// #### @pmodule {Module} Parent module to read from.
-// #### @dir {string} **Optional** Directory to start search from.
-// Searches up the directory tree from `dir` until it finds a directory
-// which contains a `package.json` file.
-//
-pkginfo.find = function (pmodule, dir) {
- if (! dir) {
- dir = path.dirname(pmodule.filename);
- }
-
- var files = fs.readdirSync(dir);
-
- if (~files.indexOf('package.json')) {
- return path.join(dir, 'package.json');
- }
-
- if (dir === '/') {
- throw new Error('Could not find package.json up from: ' + dir);
- }
- else if (!dir || dir === '.') {
- throw new Error('Cannot find package.json from unspecified directory');
- }
-
- return pkginfo.find(pmodule, path.dirname(dir));
-};
-
-//
-// ### function read (pmodule, dir)
-// #### @pmodule {Module} Parent module to read from.
-// #### @dir {string} **Optional** Directory to start search from.
-// Searches up the directory tree from `dir` until it finds a directory
-// which contains a `package.json` file and returns the package information.
-//
-pkginfo.read = function (pmodule, dir) {
- dir = pkginfo.find(pmodule, dir);
-
- var data = fs.readFileSync(dir).toString();
-
- return {
- dir: dir,
- package: JSON.parse(data)
- };
-};
-
-//
-// Call `pkginfo` on this module and expose version.
-//
-pkginfo(module, {
- dir: __dirname,
- include: ['version'],
- target: pkginfo
-});
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/package.json b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/package.json
deleted file mode 100644
index 968bcc1ca..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/package.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "name": "pkginfo",
- "version": "0.3.0",
- "description": "An easy way to expose properties on a module from a package.json",
- "author": {
- "name": "Charlie Robbins",
- "email": "charlie.robbins@gmail.com"
- },
- "repository": {
- "type": "git",
- "url": "http://github.com/indexzero/node-pkginfo.git"
- },
- "keywords": [
- "info",
- "tools",
- "package.json"
- ],
- "devDependencies": {
- "vows": "0.7.x"
- },
- "main": "./lib/pkginfo",
- "scripts": {
- "test": "vows test/*-test.js --spec"
- },
- "engines": {
- "node": ">= 0.4.0"
- },
- "readme": "# node-pkginfo\n\nAn easy way to expose properties on a module from a package.json\n\n## Installation\n\n### Installing npm (node package manager)\n```\n curl http://npmjs.org/install.sh | sh\n```\n\n### Installing pkginfo\n```\n [sudo] npm install pkginfo\n```\n\n## Motivation\nHow often when writing node.js modules have you written the following line(s) of code? \n\n* Hard code your version string into your code\n\n``` js\n exports.version = '0.1.0';\n```\n\n* Programmatically expose the version from the package.json\n\n``` js\n exports.version = JSON.parse(fs.readFileSync('/path/to/package.json', 'utf8')).version;\n```\n\nIn other words, how often have you wanted to expose basic information from your package.json onto your module programmatically? **WELL NOW YOU CAN!**\n\n## Usage\n\nUsing `pkginfo` is idiot-proof, just require and invoke it. \n\n``` js\n var pkginfo = require('pkginfo')(module);\n \n console.dir(module.exports);\n```\n\nBy invoking the `pkginfo` module all of the properties in your `package.json` file will be automatically exposed on the callee module (i.e. the parent module of `pkginfo`). \n\nHere's a sample of the output:\n\n```\n { name: 'simple-app',\n description: 'A test fixture for pkginfo',\n version: '0.1.0',\n author: 'Charlie Robbins ',\n keywords: [ 'test', 'fixture' ],\n main: './index.js',\n scripts: { test: 'vows test/*-test.js --spec' },\n engines: { node: '>= 0.4.0' } }\n```\n\n### Expose specific properties\nIf you don't want to expose **all** properties on from your `package.json` on your module then simple pass those properties to the `pkginfo` function:\n\n``` js\n var pkginfo = require('pkginfo')(module, 'version', 'author');\n \n console.dir(module.exports);\n```\n\n```\n { version: '0.1.0',\n author: 'Charlie Robbins ' }\n```\n\nIf you're looking for further usage see the [examples][0] included in this repository. \n\n## Run Tests\nTests are written in [vows][1] and give complete coverage of all APIs.\n\n```\n vows test/*-test.js --spec\n```\n\n[0]: https://github.com/indexzero/node-pkginfo/tree/master/examples\n[1]: http://vowsjs.org\n\n#### Author: [Charlie Robbins](http://nodejitsu.com)\n#### License: MIT",
- "readmeFilename": "README.md",
- "_id": "pkginfo@0.3.0",
- "dist": {
- "shasum": "726411401039fe9b009eea86614295d5f3a54276",
- "tarball": "http://registry.npmjs.org/pkginfo/-/pkginfo-0.3.0.tgz"
- },
- "_npmVersion": "1.1.66",
- "_npmUser": {
- "name": "indexzero",
- "email": "charlie.robbins@gmail.com"
- },
- "maintainers": [
- {
- "name": "indexzero",
- "email": "charlie.robbins@gmail.com"
- }
- ],
- "directories": {},
- "_shasum": "726411401039fe9b009eea86614295d5f3a54276",
- "_from": "pkginfo@0.x.x",
- "_resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.0.tgz",
- "bugs": {
- "url": "https://github.com/indexzero/node-pkginfo/issues"
- },
- "homepage": "https://github.com/indexzero/node-pkginfo"
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/test/pkginfo-test.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/test/pkginfo-test.js
deleted file mode 100644
index a59f077e8..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/pkginfo/test/pkginfo-test.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * pkginfo-test.js: Tests for the pkginfo module.
- *
- * (C) 2011, Charlie Robbins
- *
- */
-
-var assert = require('assert'),
- exec = require('child_process').exec,
- fs = require('fs'),
- path = require('path'),
- vows = require('vows'),
- pkginfo = require('../lib/pkginfo');
-
-function assertProperties (source, target) {
- assert.lengthOf(source, target.length + 1);
- target.forEach(function (prop) {
- assert.isTrue(!!~source.indexOf(prop));
- });
-}
-
-function compareWithExample(targetPath) {
- var examplePaths = ['package.json'];
-
- if (targetPath) {
- examplePaths.unshift(targetPath);
- }
-
- return function(exposed) {
- var pkg = fs.readFileSync(path.join.apply(null, [__dirname, '..', 'examples'].concat(examplePaths))).toString(),
- keys = Object.keys(JSON.parse(pkg));
-
- assertProperties(exposed, keys);
- };
-}
-
-function testExposes (options) {
- return {
- topic: function () {
- exec('node ' + path.join(__dirname, '..', 'examples', options.script), this.callback);
- },
- "should expose that property correctly": function (err, stdout, stderr) {
- assert.isNull(err);
-
- var exposed = stderr.match(/'(\w+)'/ig).map(function (p) {
- return p.substring(1, p.length - 1);
- });
-
- return !options.assert
- ? assertProperties(exposed, options.properties)
- : options.assert(exposed);
- }
- }
-}
-
-vows.describe('pkginfo').addBatch({
- "When using the pkginfo module": {
- "and passed a single `string` argument": testExposes({
- script: 'single-property.js',
- properties: ['version']
- }),
- "and passed multiple `string` arguments": testExposes({
- script: 'multiple-properties.js',
- properties: ['version', 'author']
- }),
- "and passed an `object` argument": testExposes({
- script: 'object-argument.js',
- properties: ['version', 'author']
- }),
- "and passed an `array` argument": testExposes({
- script: 'array-argument.js',
- properties: ['version', 'author']
- }),
- "and read from a specified directory": testExposes({
- script: 'target-dir.js',
- assert: compareWithExample('subdir')
- }),
- "and passed no arguments": testExposes({
- script: 'all-properties.js',
- assert: compareWithExample()
- })
- }
-}).export(module);
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/.npmignore b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/.npmignore
deleted file mode 100644
index 0db216bfa..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-npm-debug.log
-node_modules
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/LICENCE b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/LICENCE
deleted file mode 100644
index 74489e2e2..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/LICENCE
+++ /dev/null
@@ -1,25 +0,0 @@
-Copyright (c) Isaac Z. Schlueter
-All rights reserved.
-
-The BSD License
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/LICENSE b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/LICENSE
deleted file mode 100644
index 19129e315..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/README.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/README.md
deleted file mode 100644
index 5967fad11..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-## read
-
-For reading user input from stdin.
-
-Similar to the `readline` builtin's `question()` method, but with a
-few more features.
-
-## USAGE
-
-```javascript
-var read = require("read")
-read(options, callback)
-```
-
-The callback gets called with either the user input, or the default
-specified, or an error, as `callback(error, result, isDefault)`
-node style.
-
-## OPTIONS
-
-Every option is optional.
-
-* `prompt` What to write to stdout before reading input.
-* `silent` Don't echo the output as the user types it.
-* `replace` Replace silenced characters with the supplied character value.
-* `timeout` Number of ms to wait for user input before giving up.
-* `default` The default value if the user enters nothing.
-* `edit` Allow the user to edit the default value.
-* `terminal` Treat the output as a TTY, whether it is or not.
-* `input` Readable stream to get input data from. (default `process.stdin`)
-* `output` Writeable stream to write prompts to. (default: `process.stdout`)
-
-If silent is true, and the input is a TTY, then read will set raw
-mode, and read character by character.
-
-## COMPATIBILITY
-
-This module works sort of with node 0.6. It does not work with node
-versions less than 0.6. It is best on node 0.8.
-
-On node version 0.6, it will remove all listeners on the input
-stream's `data` and `keypress` events, because the readline module did
-not fully clean up after itself in that version of node, and did not
-make it possible to clean up after it in a way that has no potential
-for side effects.
-
-Additionally, some of the readline options (like `terminal`) will not
-function in versions of node before 0.8, because they were not
-implemented in the builtin readline module.
-
-## CONTRIBUTING
-
-Patches welcome.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/example/example.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/example/example.js
deleted file mode 100644
index cf213bf88..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/example/example.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var read = require("../lib/read.js")
-
-read({prompt: "Username: ", default: "test-user" }, function (er, user) {
- read({prompt: "Password: ", default: "test-pass", silent: true }, function (er, pass) {
- read({prompt: "Password again: ", default: "test-pass", silent: true }, function (er, pass2) {
- console.error({user: user,
- pass: pass,
- verify: pass2,
- passMatch: (pass === pass2)})
- console.error("the program should exit now")
- })
- })
-})
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/lib/read.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/lib/read.js
deleted file mode 100644
index a93d1b3b5..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/lib/read.js
+++ /dev/null
@@ -1,113 +0,0 @@
-
-module.exports = read
-
-var readline = require('readline')
-var Mute = require('mute-stream')
-
-function read (opts, cb) {
- if (opts.num) {
- throw new Error('read() no longer accepts a char number limit')
- }
-
- if (typeof opts.default !== 'undefined' &&
- typeof opts.default !== 'string' &&
- typeof opts.default !== 'number') {
- throw new Error('default value must be string or number')
- }
-
- var input = opts.input || process.stdin
- var output = opts.output || process.stdout
- var prompt = (opts.prompt || '').trim() + ' '
- var silent = opts.silent
- var editDef = false
- var timeout = opts.timeout
-
- var def = opts.default || ''
- if (def) {
- if (silent) {
- prompt += '() '
- } else if (opts.edit) {
- editDef = true
- } else {
- prompt += '(' + def + ') '
- }
- }
- var terminal = !!(opts.terminal || output.isTTY)
-
- var m = new Mute({ replace: opts.replace, prompt: prompt })
- m.pipe(output, {end: false})
- output = m
- var rlOpts = { input: input, output: output, terminal: terminal }
-
- if (process.version.match(/^v0\.6/)) {
- var rl = readline.createInterface(rlOpts.input, rlOpts.output)
- } else {
- var rl = readline.createInterface(rlOpts)
- }
-
-
- output.unmute()
- rl.setPrompt(prompt)
- rl.prompt()
- if (silent) {
- output.mute()
- } else if (editDef) {
- rl.line = def
- rl.cursor = def.length
- rl._refreshLine()
- }
-
- var called = false
- rl.on('line', onLine)
- rl.on('error', onError)
-
- rl.on('SIGINT', function () {
- rl.close()
- onError(new Error('canceled'))
- })
-
- var timer
- if (timeout) {
- timer = setTimeout(function () {
- onError(new Error('timed out'))
- }, timeout)
- }
-
- function done () {
- called = true
- rl.close()
-
- if (process.version.match(/^v0\.6/)) {
- rl.input.removeAllListeners('data')
- rl.input.removeAllListeners('keypress')
- rl.input.pause()
- }
-
- clearTimeout(timer)
- output.mute()
- output.end()
- }
-
- function onError (er) {
- if (called) return
- done()
- return cb(er)
- }
-
- function onLine (line) {
- if (called) return
- if (silent && terminal) {
- output.unmute()
- output.write('\r\n')
- }
- done()
- // truncate the \n at the end.
- line = line.replace(/\r?\n$/, '')
- var isDefault = !!(editDef && line === def)
- if (def && !line) {
- isDefault = true
- line = def
- }
- cb(null, line, isDefault)
- }
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/LICENSE b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/LICENSE
deleted file mode 100644
index 19129e315..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/README.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/README.md
deleted file mode 100644
index 8ab1238e4..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/README.md
+++ /dev/null
@@ -1,68 +0,0 @@
-# mute-stream
-
-Bytes go in, but they don't come out (when muted).
-
-This is a basic pass-through stream, but when muted, the bytes are
-silently dropped, rather than being passed through.
-
-## Usage
-
-```javascript
-var MuteStream = require('mute-stream')
-
-var ms = new MuteStream(options)
-
-ms.pipe(process.stdout)
-ms.write('foo') // writes 'foo' to stdout
-ms.mute()
-ms.write('bar') // does not write 'bar'
-ms.unmute()
-ms.write('baz') // writes 'baz' to stdout
-
-// can also be used to mute incoming data
-var ms = new MuteStream
-input.pipe(ms)
-
-ms.on('data', function (c) {
- console.log('data: ' + c)
-})
-
-input.emit('data', 'foo') // logs 'foo'
-ms.mute()
-input.emit('data', 'bar') // does not log 'bar'
-ms.unmute()
-input.emit('data', 'baz') // logs 'baz'
-```
-
-## Options
-
-All options are optional.
-
-* `replace` Set to a string to replace each character with the
- specified string when muted. (So you can show `****` instead of the
- password, for example.)
-
-* `prompt` If you are using a replacement char, and also using a
- prompt with a readline stream (as for a `Password: *****` input),
- then specify what the prompt is so that backspace will work
- properly. Otherwise, pressing backspace will overwrite the prompt
- with the replacement character, which is weird.
-
-## ms.mute()
-
-Set `muted` to `true`. Turns `.write()` into a no-op.
-
-## ms.unmute()
-
-Set `muted` to `false`
-
-## ms.isTTY
-
-True if the pipe destination is a TTY, or if the incoming pipe source is
-a TTY.
-
-## Other stream methods...
-
-The other standard readable and writable stream methods are all
-available. The MuteStream object acts as a facade to its pipe source
-and destination.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/mute.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/mute.js
deleted file mode 100644
index 42eac31e1..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/mute.js
+++ /dev/null
@@ -1,140 +0,0 @@
-var Stream = require('stream')
-
-module.exports = MuteStream
-
-// var out = new MuteStream(process.stdout)
-// argument auto-pipes
-function MuteStream (opts) {
- Stream.apply(this)
- opts = opts || {}
- this.writable = this.readable = true
- this.muted = false
- this.on('pipe', this._onpipe)
- this.replace = opts.replace
-
- // For readline-type situations
- // This much at the start of a line being redrawn after a ctrl char
- // is seen (such as backspace) won't be redrawn as the replacement
- this._prompt = opts.prompt || null
- this._hadControl = false
-}
-
-MuteStream.prototype = Object.create(Stream.prototype)
-
-Object.defineProperty(MuteStream.prototype, 'constructor', {
- value: MuteStream,
- enumerable: false
-})
-
-MuteStream.prototype.mute = function () {
- this.muted = true
-}
-
-MuteStream.prototype.unmute = function () {
- this.muted = false
-}
-
-Object.defineProperty(MuteStream.prototype, '_onpipe', {
- value: onPipe,
- enumerable: false,
- writable: true,
- configurable: true
-})
-
-function onPipe (src) {
- this._src = src
-}
-
-Object.defineProperty(MuteStream.prototype, 'isTTY', {
- get: getIsTTY,
- set: setIsTTY,
- enumerable: true,
- configurable: true
-})
-
-function getIsTTY () {
- return( (this._dest) ? this._dest.isTTY
- : (this._src) ? this._src.isTTY
- : false
- )
-}
-
-// basically just get replace the getter/setter with a regular value
-function setIsTTY (isTTY) {
- Object.defineProperty(this, 'isTTY', {
- value: isTTY,
- enumerable: true,
- writable: true,
- configurable: true
- })
-}
-
-Object.defineProperty(MuteStream.prototype, 'rows', {
- get: function () {
- return( this._dest ? this._dest.rows
- : this._src ? this._src.rows
- : undefined )
- }, enumerable: true, configurable: true })
-
-Object.defineProperty(MuteStream.prototype, 'columns', {
- get: function () {
- return( this._dest ? this._dest.columns
- : this._src ? this._src.columns
- : undefined )
- }, enumerable: true, configurable: true })
-
-
-MuteStream.prototype.pipe = function (dest) {
- this._dest = dest
- return Stream.prototype.pipe.call(this, dest)
-}
-
-MuteStream.prototype.pause = function () {
- if (this._src) return this._src.pause()
-}
-
-MuteStream.prototype.resume = function () {
- if (this._src) return this._src.resume()
-}
-
-MuteStream.prototype.write = function (c) {
- if (this.muted) {
- if (!this.replace) return true
- if (c.match(/^\u001b/)) {
- this._hadControl = true
- return this.emit('data', c)
- } else {
- if (this._prompt && this._hadControl &&
- c.indexOf(this._prompt) === 0) {
- this._hadControl = false
- this.emit('data', this._prompt)
- c = c.substr(this._prompt.length)
- }
- c = c.toString().replace(/./g, this.replace)
- }
- }
- this.emit('data', c)
-}
-
-MuteStream.prototype.end = function (c) {
- if (this.muted) {
- if (c && this.replace) {
- c = c.toString().replace(/./g, this.replace)
- } else {
- c = null
- }
- }
- if (c) this.emit('data', c)
- this.emit('end')
-}
-
-function proxy (fn) { return function () {
- var d = this._dest
- var s = this._src
- if (d && d[fn]) d[fn].apply(d, arguments)
- if (s && s[fn]) s[fn].apply(s, arguments)
-}}
-
-MuteStream.prototype.destroy = proxy('destroy')
-MuteStream.prototype.destroySoon = proxy('destroySoon')
-MuteStream.prototype.close = proxy('close')
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/package.json b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/package.json
deleted file mode 100644
index 8fe251b17..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "mute-stream",
- "version": "0.0.5",
- "main": "mute.js",
- "directories": {
- "test": "test"
- },
- "devDependencies": {
- "tap": "~0.2.5"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/mute-stream.git"
- },
- "keywords": [
- "mute",
- "stream",
- "pipe"
- ],
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "license": "ISC",
- "description": "Bytes go in, but they don't come out (when muted).",
- "gitHead": "17d9854a315f56088d039534f87b740e470a9af0",
- "bugs": {
- "url": "https://github.com/isaacs/mute-stream/issues"
- },
- "homepage": "https://github.com/isaacs/mute-stream#readme",
- "_id": "mute-stream@0.0.5",
- "_shasum": "8fbfabb0a98a253d3184331f9e8deb7372fac6c0",
- "_from": "mute-stream@~0.0.4",
- "_npmVersion": "2.10.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "8fbfabb0a98a253d3184331f9e8deb7372fac6c0",
- "tarball": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz",
- "readme": "ERROR: No README data found!"
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/test/basic.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/test/basic.js
deleted file mode 100644
index 41f9e10c3..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/node_modules/mute-stream/test/basic.js
+++ /dev/null
@@ -1,207 +0,0 @@
-var Stream = require('stream')
-var tap = require('tap')
-var MS = require('../mute.js')
-
-// some marker objects
-var END = {}
-var PAUSE = {}
-var RESUME = {}
-
-function PassThrough () {
- Stream.call(this)
- this.readable = this.writable = true
-}
-
-PassThrough.prototype = Object.create(Stream.prototype, {
- constructor: {
- value: PassThrough
- },
- write: {
- value: function (c) {
- this.emit('data', c)
- return true
- }
- },
- end: {
- value: function (c) {
- if (c) this.write(c)
- this.emit('end')
- }
- },
- pause: {
- value: function () {
- this.emit('pause')
- }
- },
- resume: {
- value: function () {
- this.emit('resume')
- }
- }
-})
-
-tap.test('incoming', function (t) {
- var ms = new MS
- var str = new PassThrough
- str.pipe(ms)
-
- var expect = ['foo', 'boo', END]
- ms.on('data', function (c) {
- t.equal(c, expect.shift())
- })
- ms.on('end', function () {
- t.equal(END, expect.shift())
- t.end()
- })
- str.write('foo')
- ms.mute()
- str.write('bar')
- ms.unmute()
- str.write('boo')
- ms.mute()
- str.write('blaz')
- str.end('grelb')
-})
-
-tap.test('outgoing', function (t) {
- var ms = new MS
- var str = new PassThrough
- ms.pipe(str)
-
- var expect = ['foo', 'boo', END]
- str.on('data', function (c) {
- t.equal(c, expect.shift())
- })
- str.on('end', function () {
- t.equal(END, expect.shift())
- t.end()
- })
-
- ms.write('foo')
- ms.mute()
- ms.write('bar')
- ms.unmute()
- ms.write('boo')
- ms.mute()
- ms.write('blaz')
- ms.end('grelb')
-})
-
-tap.test('isTTY', function (t) {
- var str = new PassThrough
- str.isTTY = true
- str.columns=80
- str.rows=24
-
- var ms = new MS
- t.equal(ms.isTTY, false)
- t.equal(ms.columns, undefined)
- t.equal(ms.rows, undefined)
- ms.pipe(str)
- t.equal(ms.isTTY, true)
- t.equal(ms.columns, 80)
- t.equal(ms.rows, 24)
- str.isTTY = false
- t.equal(ms.isTTY, false)
- t.equal(ms.columns, 80)
- t.equal(ms.rows, 24)
- str.isTTY = true
- t.equal(ms.isTTY, true)
- t.equal(ms.columns, 80)
- t.equal(ms.rows, 24)
- ms.isTTY = false
- t.equal(ms.isTTY, false)
- t.equal(ms.columns, 80)
- t.equal(ms.rows, 24)
-
- ms = new MS
- t.equal(ms.isTTY, false)
- str.pipe(ms)
- t.equal(ms.isTTY, true)
- str.isTTY = false
- t.equal(ms.isTTY, false)
- str.isTTY = true
- t.equal(ms.isTTY, true)
- ms.isTTY = false
- t.equal(ms.isTTY, false)
-
- t.end()
-})
-
-tap.test('pause/resume incoming', function (t) {
- var str = new PassThrough
- var ms = new MS
- str.on('pause', function () {
- t.equal(PAUSE, expect.shift())
- })
- str.on('resume', function () {
- t.equal(RESUME, expect.shift())
- })
- var expect = [PAUSE, RESUME, PAUSE, RESUME]
- str.pipe(ms)
- ms.pause()
- ms.resume()
- ms.pause()
- ms.resume()
- t.equal(expect.length, 0, 'saw all events')
- t.end()
-})
-
-tap.test('replace with *', function (t) {
- var str = new PassThrough
- var ms = new MS({replace: '*'})
- str.pipe(ms)
- var expect = ['foo', '*****', 'bar', '***', 'baz', 'boo', '**', '****']
-
- ms.on('data', function (c) {
- t.equal(c, expect.shift())
- })
-
- str.write('foo')
- ms.mute()
- str.write('12345')
- ms.unmute()
- str.write('bar')
- ms.mute()
- str.write('baz')
- ms.unmute()
- str.write('baz')
- str.write('boo')
- ms.mute()
- str.write('xy')
- str.write('xyzΩ')
-
- t.equal(expect.length, 0)
- t.end()
-})
-
-tap.test('replace with ~YARG~', function (t) {
- var str = new PassThrough
- var ms = new MS({replace: '~YARG~'})
- str.pipe(ms)
- var expect = ['foo', '~YARG~~YARG~~YARG~~YARG~~YARG~', 'bar',
- '~YARG~~YARG~~YARG~', 'baz', 'boo', '~YARG~~YARG~',
- '~YARG~~YARG~~YARG~~YARG~']
-
- ms.on('data', function (c) {
- t.equal(c, expect.shift())
- })
-
- // also throw some unicode in there, just for good measure.
- str.write('foo')
- ms.mute()
- str.write('ΩΩ')
- ms.unmute()
- str.write('bar')
- ms.mute()
- str.write('Ω')
- ms.unmute()
- str.write('baz')
- str.write('boo')
- ms.mute()
- str.write('Ω')
- str.write('ΩΩ')
-
- t.equal(expect.length, 0)
- t.end()
-})
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/package.json b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/package.json
deleted file mode 100644
index 1a7078bdc..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/package.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "name": "read",
- "version": "1.0.6",
- "main": "lib/read.js",
- "dependencies": {
- "mute-stream": "~0.0.4"
- },
- "devDependencies": {
- "tap": "*"
- },
- "engines": {
- "node": ">=0.8"
- },
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "description": "read(1) for node programs",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/read.git"
- },
- "license": "ISC",
- "scripts": {
- "test": "tap test/*.js"
- },
- "gitHead": "2f5101c8e41332a033e5aa4e27e33fd6e09598e2",
- "bugs": {
- "url": "https://github.com/isaacs/read/issues"
- },
- "homepage": "https://github.com/isaacs/read#readme",
- "_id": "read@1.0.6",
- "_shasum": "09873c14ecc114d063fad43b8ca5a33d304721c8",
- "_from": "read@1.0.x",
- "_npmVersion": "2.10.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "09873c14ecc114d063fad43b8ca5a33d304721c8",
- "tarball": "http://registry.npmjs.org/read/-/read-1.0.6.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/read/-/read-1.0.6.tgz",
- "readme": "ERROR: No README data found!"
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/rs.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/rs.js
deleted file mode 100644
index d9f7f48dd..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/rs.js
+++ /dev/null
@@ -1,4 +0,0 @@
-var read = require('read');
-read({ silent: true, prompt: 'stars: ' }, function(er, data) {
- console.log(er, data)
-})
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/basic.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/basic.js
deleted file mode 100644
index f0926f3f2..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/basic.js
+++ /dev/null
@@ -1,60 +0,0 @@
-var tap = require('tap')
-var read = require('../lib/read.js')
-
-if (process.argv[2] === 'child') {
- return child()
-}
-
-var CLOSE = 'close'
-if (process.version.match(/^v0\.6/)) {
- CLOSE = 'exit'
-}
-
-var spawn = require('child_process').spawn
-
-tap.test('basic', function (t) {
- var child = spawn(process.execPath, [__filename, 'child'])
- var output = ''
- var write = child.stdin.write.bind(child.stdin)
- child.stdout.on('data', function (c) {
- console.error('data %s', c)
- output += c
- if (output.match(/Username: \(test-user\) $/)) {
- process.nextTick(write.bind(null, 'a user\n'))
- } else if (output.match(/Password: \(\) $/)) {
- process.nextTick(write.bind(null, 'a password\n'))
- } else if (output.match(/Password again: \(\) $/)) {
- process.nextTick(write.bind(null, 'a password\n'))
- } else {
- console.error('prompts done, output=%j', output)
- }
- })
-
- var result = ''
- child.stderr.on('data', function (c) {
- result += c
- console.error('result %j', c.toString())
- })
-
- child.on(CLOSE, function () {
- result = JSON.parse(result)
- t.same(result, {"user":"a user","pass":"a password","verify":"a password","passMatch":true})
- t.equal(output, 'Username: (test-user) Password: () Password again: () ')
- t.end()
- })
-})
-
-function child () {
- read({prompt: "Username: ", default: "test-user" }, function (er, user) {
- read({prompt: "Password: ", default: "test-pass", silent: true }, function (er, pass) {
- read({prompt: "Password again: ", default: "test-pass", silent: true }, function (er, pass2) {
- console.error(JSON.stringify({user: user,
- pass: pass,
- verify: pass2,
- passMatch: (pass === pass2)}))
- if (process.stdin.unref)
- process.stdin.unref()
- })
- })
- })
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/defaults.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/defaults.js
deleted file mode 100644
index e3d2ac710..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/defaults.js
+++ /dev/null
@@ -1,60 +0,0 @@
-var tap = require('tap')
-var read = require('../lib/read.js')
-
-if (process.argv[2] === 'child') {
- return child()
-}
-
-var CLOSE = 'close'
-if (process.version.match(/^v0\.6/)) {
- CLOSE = 'exit'
-}
-
-var spawn = require('child_process').spawn
-
-tap.test('defaults', function (t) {
- var child = spawn(process.execPath, [__filename, 'child'])
- var output = ''
- var write = child.stdin.write.bind(child.stdin)
- child.stdout.on('data', function (c) {
- console.error('data %s', c)
- output += c
- if (output.match(/Username: \(test-user\) $/)) {
- process.nextTick(write.bind(null, '\n'))
- } else if (output.match(/Password: \(\) $/)) {
- process.nextTick(write.bind(null, '\n'))
- } else if (output.match(/Password again: \(\) $/)) {
- process.nextTick(write.bind(null, '\n'))
- } else {
- console.error('prompts done, output=%j', output)
- }
- })
-
- var result = ''
- child.stderr.on('data', function (c) {
- result += c
- console.error('result %j', c.toString())
- })
-
- child.on(CLOSE, function () {
- result = JSON.parse(result)
- t.same(result, {"user":"test-user","pass":"test-pass","verify":"test-pass","passMatch":true})
- t.equal(output, 'Username: (test-user) Password: () Password again: () ')
- t.end()
- })
-})
-
-function child () {
- read({prompt: "Username: ", default: "test-user" }, function (er, user) {
- read({prompt: "Password: ", default: "test-pass", silent: true }, function (er, pass) {
- read({prompt: "Password again: ", default: "test-pass", silent: true }, function (er, pass2) {
- console.error(JSON.stringify({user: user,
- pass: pass,
- verify: pass2,
- passMatch: (pass === pass2)}))
- if (process.stdin.unref)
- process.stdin.unref()
- })
- })
- })
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/many.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/many.js
deleted file mode 100644
index 6a2f87b86..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/read/test/many.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var tap = require('tap')
-var read = require('../lib/read.js')
-
-var CLOSE = 'close'
-if (process.version.match(/^v0\.6/)) {
- CLOSE = 'exit'
-}
-
-if (process.argv[2] === 'child') {
- return child()
-}
-
-var spawn = require('child_process').spawn
-function child () {
- read({prompt:'1'}, function (er, r1) {if (er) throw er
- read({prompt:'2'}, function (er, r2) {if (er) throw er
- read({prompt:'3'}, function (er, r3) {if (er) throw er
- read({prompt:'4'}, function (er, r4) {if (er) throw er
- read({prompt:'5'}, function (er, r5) {if (er) throw er
- read({prompt:'6'}, function (er, r6) {if (er) throw er
- read({prompt:'7'}, function (er, r7) {if (er) throw er
- read({prompt:'8'}, function (er, r8) {if (er) throw er
- read({prompt:'9'}, function (er, r9) {if (er) throw er
- read({prompt:'10'}, function (er, r10) {if (er) throw er
- read({prompt:'11'}, function (er, r11) {if (er) throw er
- read({prompt:'12'}, function (er, r12) {if (er) throw er
- read({prompt:'13'}, function (er, r13) {if (er) throw er
- read({prompt:'14'}, function (er, r14) {if (er) throw er
- read({prompt:'15'}, function (er, r15) {if (er) throw er
- read({prompt:'16'}, function (er, r16) {if (er) throw er
- read({prompt:'17'}, function (er, r17) {if (er) throw er
- read({prompt:'18'}, function (er, r18) {if (er) throw er
- console.log(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10,
- r11, r12, r13, r14, r15, r16, r17, r18)
- if (process.stdin.unref)
- process.stdin.unref()
- })})})})})})})})})})})})})})})})})})
-}
-
-tap.test('many reads', function (t) {
- var child = spawn(process.execPath, [__filename, 'child'])
- var n = 0
- var output = ''
- var expect = '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ' +
- '16 17 18 1 2 3 4 5 6 7 8 9 10 11 12 ' +
- '13 14 15 16 17 18\n'
- var write = child.stdin.write.bind(child.stdin)
- var answers =
- [ '1\n',
- '2\n',
- '3\n',
- '4\n',
- '5\n',
- '6\n',
- '7\n',
- '8\n',
- '9\n',
- '10\n',
- '11\n',
- '12\n',
- '13\n',
- '14\n',
- '15\n',
- '16\n',
- '17\n',
- '18\n' ]
- child.stdout.on('data', function (c) {
- n++;
- output += c
- if (answers.length) {
- write(answers.shift())
- }
- })
- child.stderr.on('data', function (c) {
- output += c
- console.error('' + c)
- })
- child.on(CLOSE, function (c) {
- t.equal(output, expect)
- t.equal(n, 19)
- t.end()
- })
-})
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/.npmignore b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/.npmignore
deleted file mode 100644
index 5171c5408..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-npm-debug.log
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/.travis.yml b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/.travis.yml
deleted file mode 100644
index 04d6dd920..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: node_js
-node_js:
- - "0.8"
- - "0.10"
- - "0.11"
-
-notifications:
- email:
- - travis@nodejitsu.com
- irc: "irc.freenode.org#nodejitsu"
-
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/CHANGELOG.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/CHANGELOG.md
deleted file mode 100644
index 8befb22c9..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/CHANGELOG.md
+++ /dev/null
@@ -1,25 +0,0 @@
-
-0.1.3 / 2012-10-17
-==================
-
- * Fixed case problem with types
-
-0.1.2 / 2012-06-27
-==================
-
- * Added host-name String format
- * Added support for additionalProperties
- * Added few default validation messages for formats
-
-0.1.1 / 2012-04-16
-==================
-
- * Added default and custom error message support
- * Added suport for conform function
- * Updated date-time format
-
-0.1.0 / 2011-11-09
-=================
-
- * Initial release
-
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/LICENSE b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/LICENSE
deleted file mode 100644
index a83d17947..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/LICENSE
+++ /dev/null
@@ -1,179 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-Copyright (c) 2009-2010 Alexis Sellier, Charlie Robbins, Nodejitsu Inc.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/README.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/README.md
deleted file mode 100644
index be6601b21..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/README.md
+++ /dev/null
@@ -1,301 +0,0 @@
-# revalidator [](http://travis-ci.org/flatiron/revalidator)
-
-A cross-browser / node.js validator used by resourceful and flatiron. Revalidator has [JSONSchema](http://tools.ietf.org/html/draft-zyp-json-schema-04) compatibility as primary goal.
-
-## Example
-The core of `revalidator` is simple and succinct: `revalidator.validate(obj, schema)`:
-
-``` js
- var revalidator = require('revalidator');
-
- console.dir(revalidator.validate(someObject, {
- properties: {
- url: {
- description: 'the url the object should be stored at',
- type: 'string',
- pattern: '^/[^#%&*{}\\:<>?\/+]+$',
- required: true
- },
- challenge: {
- description: 'a means of protecting data (insufficient for production, used as example)',
- type: 'string',
- minLength: 5
- },
- body: {
- description: 'what to store at the url',
- type: 'any',
- default: null
- }
- }
- }));
-```
-
-This will return with a value indicating if the `obj` conforms to the `schema`. If it does not, a descriptive object will be returned containing the errors encountered with validation.
-
-``` js
- {
- valid: true // or false
- errors: [/* Array of errors if valid is false */]
- }
-```
-
-In the browser, the validation function is exposed on `window.validate` by simply including `revalidator.js`.
-
-## Installation
-
-### Installing npm (node package manager)
-``` bash
- $ curl http://npmjs.org/install.sh | sh
-```
-
-### Installing revalidator
-``` bash
- $ [sudo] npm install revalidator
-```
-
-## Usage
-
-`revalidator` takes json-schema as input to validate objects.
-
-### revalidator.validate (obj, schema, options)
-
-This will return with a value indicating if the `obj` conforms to the `schema`. If it does not, a descriptive object will be returned containing the errors encountered with validation.
-
-``` js
-{
- valid: true // or false
- errors: [/* Array of errors if valid is false */]
-}
-```
-
-#### Available Options
-
-* __validateFormats__: Enforce format constraints (_default true_)
-* __validateFormatsStrict__: When `validateFormats` is _true_ treat unrecognized formats as validation errors (_default false_)
-* __validateFormatExtensions__: When `validateFormats` is _true_ also validate formats defined in `validate.formatExtensions` (_default true_)
-* __cast__: Enforce casting of some types (for integers/numbers are only supported) when it's possible, e.g. `"42" => 42`, but `"forty2" => "forty2"` for the `integer` type.
-
-### Schema
-For a property an `value` is that which is given as input for validation where as an `expected value` is the value of the below fields
-
-#### required
-If true, the value should not be undefined
-
-```js
-{ required: true }
-```
-
-#### allowEmpty
-If false, the value must not be an empty string
-
-```js
-{ allowEmpty: false }
-```
-
-#### type
-The `type of value` should be equal to the expected value
-
-```js
-{ type: 'string' }
-{ type: 'number' }
-{ type: 'integer' }
-{ type: 'array' }
-{ type: 'boolean' }
-{ type: 'object' }
-{ type: 'null' }
-{ type: 'any' }
-{ type: ['boolean', 'string'] }
-```
-
-#### pattern
-The expected value regex needs to be satisfied by the value
-
-```js
-{ pattern: /^[a-z]+$/ }
-```
-
-#### maxLength
-The length of value must be greater than or equal to expected value
-
-```js
-{ maxLength: 8 }
-```
-
-#### minLength
-The length of value must be lesser than or equal to expected value
-
-```js
-{ minLength: 8 }
-```
-
-#### minimum
-Value must be greater than or equal to the expected value
-
-```js
-{ minimum: 10 }
-```
-
-#### maximum
-Value must be lesser than or equal to the expected value
-
-```js
-{ maximum: 10 }
-```
-
-#### allowEmpty
-Value may not be empty
-
-```js
-{ allowEmpty: false }
-```
-
-#### exclusiveMinimum
-Value must be greater than expected value
-
-```js
-{ exclusiveMinimum: 9 }
-```
-
-### exclusiveMaximum
-Value must be lesser than expected value
-
-```js
-{ exclusiveMaximum: 11 }
-```
-
-#### divisibleBy
-Value must be divisible by expected value
-
-```js
-{ divisibleBy: 5 }
-{ divisibleBy: 0.5 }
-```
-
-#### minItems
-Value must contain more then expected value number of items
-
-```js
-{ minItems: 2 }
-```
-
-#### maxItems
-Value must contains less then expected value number of items
-
-```js
-{ maxItems: 5 }
-```
-
-#### uniqueItems
-Value must hold a unique set of values
-
-```js
-{ uniqueItems: true }
-```
-
-#### enum
-Value must be present in the array of expected value
-
-```js
-{ enum: ['month', 'year'] }
-```
-
-#### format
-Value must be a valid format
-
-```js
-{ format: 'url' }
-{ format: 'email' }
-{ format: 'ip-address' }
-{ format: 'ipv6' }
-{ format: 'date-time' }
-{ format: 'date' }
-{ format: 'time' }
-{ format: 'color' }
-{ format: 'host-name' }
-{ format: 'utc-millisec' }
-{ format: 'regex' }
-```
-
-#### conform
-Value must conform to constraint denoted by expected value
-
-```js
-{ conform: function (v) {
- if (v%3==1) return true;
- return false;
- }
-}
-```
-
-#### dependencies
-Value is valid only if the dependent value is valid
-
-```js
-{
- town: { required: true, dependencies: 'country' },
- country: { maxLength: 3, required: true }
-}
-```
-
-### Nested Schema
-We also allow nested schema
-
-```js
-{
- properties: {
- title: {
- type: 'string',
- maxLength: 140,
- required: true
- },
- author: {
- type: 'object',
- required: true,
- properties: {
- name: {
- type: 'string',
- required: true
- },
- email: {
- type: 'string',
- format: 'email'
- }
- }
- }
- }
-}
-```
-
-### Custom Messages
-We also allow custom message for different constraints
-
-```js
-{
- type: 'string',
- format: 'url'
- messages: {
- type: 'Not a string type',
- format: 'Expected format is a url'
- }
-```
-
-```js
-{
- conform: function () { ... },
- message: 'This can be used as a global message'
-}
-```
-
-## Tests
-All tests are written with [vows][0] and should be run with [npm][1]:
-
-``` bash
- $ npm test
-```
-
-#### Author: [Charlie Robbins](http://nodejitsu.com), [Alexis Sellier](http://cloudhead.io)
-#### Contributors: [Fedor Indutny](http://github.com/indutny), [Bradley Meck](http://github.com/bmeck), [Laurie Harper](http://laurie.holoweb.net/)
-#### License: Apache 2.0
-
-[0]: http://vowsjs.org
-[1]: http://npmjs.org
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/example/webservice.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/example/webservice.js
deleted file mode 100644
index 33d5f0e89..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/example/webservice.js
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// (C) 2011, Nodejitsu Inc.
-// MIT License
-//
-// A simple web service for storing JSON data via REST
-//
-// GET - View Object
-// POST - Create Object
-// PUT - Update Object
-// DELETE - Delete Object
-//
-
-var revalidator = require('../'),
- http = require('http'),
-//
-// Keep our objects in a simple memory store
-//
- memoryStore = {},
-//
-// Set up our request schema
-//
- schema = {
- properties: {
- url: {
- description: 'the url the object should be stored at',
- type: 'string',
- pattern: '^/[^#%&*{}\\:<>?\/+]+$',
- required: true
- },
- challenge: {
- description: 'a means of protecting data (insufficient for production, used as example)',
- type: 'string',
- minLength: 5
- },
- body: {
- description: 'what to store at the url',
- type: 'any',
- default: null
- }
- }
- }
-
-var server = http.createServer(function validateRestRequest (req, res) {
- req.method = req.method.toUpperCase();
-
- //
- // Log the requests
- //
- console.log(req.method, req.url);
-
- //
- // Buffer the request so it can be parsed as JSON
- //
- var requestBody = [];
- req.on('data', function addDataToBody (data) {
- requestBody.push(data);
- });
-
- //
- // Once the request has ended work with the body
- //
- req.on('end', function dealWithRest () {
-
- //
- // Parse the JSON
- //
- requestBody = requestBody.join('');
- if ({POST: 1, PUT: 1}[req.method]) {
- try {
- requestBody = JSON.parse(requestBody);
- }
- catch (e) {
- res.writeHead(400);
- res.end(e);
- return;
- }
- }
- else {
- requestBody = {};
- }
-
- //
- // If this was sent to a url but the body url was not declared
- // Make sure the body get the requested url so that our schema
- // validates before we work on it
- //
- if (!requestBody.url) {
- requestBody.url = req.url;
- }
-
- //
- // Don't let users override the main API endpoint
- //
- if (requestBody.url === '/') {
- res.writeHead(400);
- res.end('Cannot override the API endpoint "/"');
- return;
- }
-
- //
- // See if our request and target are out of sync
- // This lets us double check the url we are about to take up
- // if we choose to send the request to the url directly
- //
- if (req.url !== '/' && requestBody.url !== req.url) {
- res.writeHead(400);
- res.end('Requested url and actual url do not match');
- return;
- }
-
- //
- // Validate the schema
- //
- var validation = revalidator.validate(requestBody, schema);
- if (!validation.valid) {
- res.writeHead(400);
- res.end(validation.errors.join('\n'));
- return;
- }
-
- //
- // Grab the current value from storage and
- // check if it is a valid state for REST
- //
- var storedValue = memoryStore[requestBody.url];
- if (req.method === 'POST') {
- if (storedValue) {
- res.writeHead(400);
- res.end('ALREADY EXISTS');
- return;
- }
- }
- else if (!storedValue) {
- res.writeHead(404);
- res.end('DOES NOT EXIST');
- return;
- }
-
- //
- // Check our challenge
- //
- if (storedValue && requestBody.challenge != storedValue.challenge) {
- res.writeHead(403);
- res.end('NOT AUTHORIZED');
- return;
- }
-
- //
- // Since revalidator only checks and does not manipulate
- // our object we need to set up the defaults our selves
- // For an easier solution to this please look at Flatiron's
- // `Resourceful` project
- //
- if (requestBody.body === undefined) {
- requestBody.body = schema.properties.body.default;
- }
-
- //
- // Use REST to determine how to manipulate the stored
- // values
- //
- switch (req.method) {
-
- case "GET":
- res.writeHead(200);
- var result = storedValue.body;
- res.end(JSON.stringify(result));
- return;
-
- case "POST":
- res.writeHead(201);
- res.end();
- memoryStore[requestBody.url] = requestBody;
- return;
-
- case "DELETE":
- delete memoryStore[requestBody.url];
- res.writeHead(200);
- res.end();
- return;
-
- case "PUT":
- memoryStore[requestBody.url] = requestBody;
- res.writeHead(200);
- res.end();
- return;
-
- default:
- res.writeHead(400);
- res.end('Invalid Http Verb');
- return;
- }
- });
-})
-//
-// Listen to various ports depending on environment we are being run on
-//
-server.listen(process.env.PORT || process.env.C9_PORT || 1337, function reportListening () {
-
- console.log('JSON REST Service listening on port', this.address().port);
- console.log('Requests can be sent via REST to "/" if they conform to the following schema:');
- console.log(JSON.stringify(schema, null, ' '));
-
-});
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/lib/revalidator.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/lib/revalidator.js
deleted file mode 100644
index ad6581412..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/lib/revalidator.js
+++ /dev/null
@@ -1,427 +0,0 @@
-(function (exports) {
- exports.validate = validate;
- exports.mixin = mixin;
-
- //
- // ### function validate (object, schema, options)
- // #### {Object} object the object to validate.
- // #### {Object} schema (optional) the JSON Schema to validate against.
- // #### {Object} options (optional) options controlling the validation
- // process. See {@link #validate.defaults) for details.
- // Validate object against a JSON Schema.
- // If object is self-describing (i.e. has a
- // $schema property), it will also be validated
- // against the referenced schema. [TODO]: This behaviour bay be
- // suppressed by setting the {@link #validate.options.???}
- // option to ???.[/TODO]
- //
- // If schema is not specified, and object
- // is not self-describing, validation always passes.
- //
- // Note: in order to pass options but no schema,
- // schemamust be specified in the call to
- // validate(); otherwise, options will
- // be interpreted as the schema. schema may be passed
- // as null, undefinded, or the empty object
- // ({}) in this case.
- //
- function validate(object, schema, options) {
- options = mixin({}, options, validate.defaults);
- var errors = [];
-
- validateObject(object, schema, options, errors);
-
- //
- // TODO: self-described validation
- // if (! options.selfDescribing) { ... }
- //
-
- return {
- valid: !(errors.length),
- errors: errors
- };
- };
-
- /**
- * Default validation options. Defaults can be overridden by
- * passing an 'options' hash to {@link #validate}. They can
- * also be set globally be changing the values in
- * validate.defaults directly.
- */
- validate.defaults = {
- /**
- *
- * Enforce 'format' constraints.
- *
- * Default: true
- *
- */
- validateFormats: true,
- /**
- *
- * When {@link #validateFormats} is true,
- * treat unrecognized formats as validation errors.
- *
- * When {@link #validateFormats} is true,
- * also validate formats defined in {@link #validate.formatExtensions}.
- *
- * Default: true
- *
- */
- validateFormatExtensions: true
- };
-
- /**
- * Default messages to include with validation errors.
- */
- validate.messages = {
- required: "is required",
- allowEmpty: "must not be empty",
- minLength: "is too short (minimum is %{expected} characters)",
- maxLength: "is too long (maximum is %{expected} characters)",
- pattern: "invalid input",
- minimum: "must be greater than or equal to %{expected}",
- maximum: "must be less than or equal to %{expected}",
- exclusiveMinimum: "must be greater than %{expected}",
- exclusiveMaximum: "must be less than %{expected}",
- divisibleBy: "must be divisible by %{expected}",
- minItems: "must contain more than %{expected} items",
- maxItems: "must contain less than %{expected} items",
- uniqueItems: "must hold a unique set of values",
- format: "is not a valid %{expected}",
- conform: "must conform to given constraint",
- type: "must be of %{expected} type"
- };
- validate.messages['enum'] = "must be present in given enumerator";
-
- /**
- *
- */
- validate.formats = {
- 'email': /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
- 'ip-address': /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i,
- 'ipv6': /^([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}$/,
- 'date-time': /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:.\d{1,3})?Z$/,
- 'date': /^\d{4}-\d{2}-\d{2}$/,
- 'time': /^\d{2}:\d{2}:\d{2}$/,
- 'color': /^#[a-z0-9]{6}|#[a-z0-9]{3}|(?:rgb\(\s*(?:[+-]?\d+%?)\s*,\s*(?:[+-]?\d+%?)\s*,\s*(?:[+-]?\d+%?)\s*\))aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow$/i,
- //'style': (not supported)
- //'phone': (not supported)
- //'uri': (not supported)
- 'host-name': /^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])/,
- 'utc-millisec': {
- test: function (value) {
- return typeof(value) === 'number' && value >= 0;
- }
- },
- 'regex': {
- test: function (value) {
- try { new RegExp(value) }
- catch (e) { return false }
-
- return true;
- }
- }
- };
-
- /**
- *
- */
- validate.formatExtensions = {
- 'url': /^(https?|ftp|git):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
- };
-
- function mixin(obj) {
- var sources = Array.prototype.slice.call(arguments, 1);
- while (sources.length) {
- var source = sources.shift();
- if (!source) { continue }
-
- if (typeof(source) !== 'object') {
- throw new TypeError('mixin non-object');
- }
-
- for (var p in source) {
- if (source.hasOwnProperty(p)) {
- obj[p] = source[p];
- }
- }
- }
-
- return obj;
- };
-
- function validateObject(object, schema, options, errors) {
- var props, allProps = Object.keys(object),
- visitedProps = [];
-
- // see 5.2
- if (schema.properties) {
- props = schema.properties;
- for (var p in props) {
- if (props.hasOwnProperty(p)) {
- visitedProps.push(p);
- validateProperty(object, object[p], p, props[p], options, errors);
- }
- }
- }
-
- // see 5.3
- if (schema.patternProperties) {
- props = schema.patternProperties;
- for (var p in props) {
- if (props.hasOwnProperty(p)) {
- var re = new RegExp(p);
-
- // Find all object properties that are matching `re`
- for (var k in object) {
- if (object.hasOwnProperty(k)) {
- visitedProps.push(k);
- if (re.exec(k) !== null) {
- validateProperty(object, object[k], p, props[p], options, errors);
- }
- }
- }
- }
- }
- }
-
- // see 5.4
- if (undefined !== schema.additionalProperties) {
- var i, l;
-
- var unvisitedProps = allProps.filter(function(k){
- return -1 === visitedProps.indexOf(k);
- });
-
- // Prevent additional properties; each unvisited property is therefore an error
- if (schema.additionalProperties === false && unvisitedProps.length > 0) {
- for (i = 0, l = unvisitedProps.length; i < l; i++) {
- error("additionalProperties", unvisitedProps[i], object[unvisitedProps[i]], false, errors);
- }
- }
- // additionalProperties is a schema and validate unvisited properties against that schema
- else if (typeof schema.additionalProperties == "object" && unvisitedProps.length > 0) {
- for (i = 0, l = unvisitedProps.length; i < l; i++) {
- validateProperty(object, object[unvisitedProps[i]], unvisitedProps[i], schema.unvisitedProperties, options, errors);
- }
- }
- }
-
- };
-
- function validateProperty(object, value, property, schema, options, errors) {
- var format,
- valid,
- spec,
- type;
-
- function constrain(name, value, assert) {
- if (schema[name] !== undefined && !assert(value, schema[name])) {
- error(name, property, value, schema, errors);
- }
- }
-
- if (value === undefined) {
- if (schema.required && schema.type !== 'any') {
- return error('required', property, undefined, schema, errors);
- } else {
- return;
- }
- }
-
- if (options.cast) {
- if (('integer' === schema.type || 'number' === schema.type) && value == +value) {
- value = +value;
- object[property] = value;
- }
-
- if ('boolean' === schema.type) {
- if ('true' === value || '1' === value || 1 === value) {
- value = true;
- object[property] = value;
- }
-
- if ('false' === value || '0' === value || 0 === value) {
- value = false;
- object[property] = value;
- }
- }
- }
-
- if (schema.format && options.validateFormats) {
- format = schema.format;
-
- if (options.validateFormatExtensions) { spec = validate.formatExtensions[format] }
- if (!spec) { spec = validate.formats[format] }
- if (!spec) {
- if (options.validateFormatsStrict) {
- return error('format', property, value, schema, errors);
- }
- }
- else {
- if (!spec.test(value)) {
- return error('format', property, value, schema, errors);
- }
- }
- }
-
- if (schema['enum'] && schema['enum'].indexOf(value) === -1) {
- error('enum', property, value, schema, errors);
- }
-
- // Dependencies (see 5.8)
- if (typeof schema.dependencies === 'string' &&
- object[schema.dependencies] === undefined) {
- error('dependencies', property, null, schema, errors);
- }
-
- if (isArray(schema.dependencies)) {
- for (var i = 0, l = schema.dependencies.length; i < l; i++) {
- if (object[schema.dependencies[i]] === undefined) {
- error('dependencies', property, null, schema, errors);
- }
- }
- }
-
- if (typeof schema.dependencies === 'object') {
- validateObject(object, schema.dependencies, options, errors);
- }
-
- checkType(value, schema.type, function(err, type) {
- if (err) return error('type', property, typeof value, schema, errors);
-
- constrain('conform', value, function (a, e) { return e(a, object) });
-
- switch (type || (isArray(value) ? 'array' : typeof value)) {
- case 'string':
- constrain('allowEmpty', value, function (a, e) { return e ? e : a !== '' });
- constrain('minLength', value.length, function (a, e) { return a >= e });
- constrain('maxLength', value.length, function (a, e) { return a <= e });
- constrain('pattern', value, function (a, e) {
- e = typeof e === 'string'
- ? e = new RegExp(e)
- : e;
- return e.test(a)
- });
- break;
- case 'integer':
- case 'number':
- constrain('minimum', value, function (a, e) { return a >= e });
- constrain('maximum', value, function (a, e) { return a <= e });
- constrain('exclusiveMinimum', value, function (a, e) { return a > e });
- constrain('exclusiveMaximum', value, function (a, e) { return a < e });
- constrain('divisibleBy', value, function (a, e) {
- var multiplier = Math.max((a - Math.floor(a)).toString().length - 2, (e - Math.floor(e)).toString().length - 2);
- multiplier = multiplier > 0 ? Math.pow(10, multiplier) : 1;
- return (a * multiplier) % (e * multiplier) === 0
- });
- break;
- case 'array':
- constrain('items', value, function (a, e) {
- for (var i = 0, l = a.length; i < l; i++) {
- validateProperty(object, a[i], property, e, options, errors);
- }
- return true;
- });
- constrain('minItems', value, function (a, e) { return a.length >= e });
- constrain('maxItems', value, function (a, e) { return a.length <= e });
- constrain('uniqueItems', value, function (a) {
- var h = {};
-
- for (var i = 0, l = a.length; i < l; i++) {
- var key = JSON.stringify(a[i]);
- if (h[key]) return false;
- h[key] = true;
- }
-
- return true;
- });
- break;
- case 'object':
- // Recursive validation
- if (schema.properties || schema.patternProperties || schema.additionalProperties) {
- validateObject(value, schema, options, errors);
- }
- break;
- }
- });
- };
-
- function checkType(val, type, callback) {
- var result = false,
- types = isArray(type) ? type : [type];
-
- // No type - no check
- if (type === undefined) return callback(null, type);
-
- // Go through available types
- // And fine first matching
- for (var i = 0, l = types.length; i < l; i++) {
- type = types[i].toLowerCase().trim();
- if (type === 'string' ? typeof val === 'string' :
- type === 'array' ? isArray(val) :
- type === 'object' ? val && typeof val === 'object' &&
- !isArray(val) :
- type === 'number' ? typeof val === 'number' :
- type === 'integer' ? typeof val === 'number' && ~~val === val :
- type === 'null' ? val === null :
- type === 'boolean'? typeof val === 'boolean' :
- type === 'date' ? isDate(val) :
- type === 'any' ? typeof val !== 'undefined' : false) {
- return callback(null, type);
- }
- };
-
- callback(true);
- };
-
- function error(attribute, property, actual, schema, errors) {
- var lookup = { expected: schema[attribute], actual: actual, attribute: attribute, property: property };
- var message = schema.messages && schema.messages[attribute] || schema.message || validate.messages[attribute] || "no default message";
- message = message.replace(/%\{([a-z]+)\}/ig, function (_, match) { return lookup[match.toLowerCase()] || ''; });
- errors.push({
- attribute: attribute,
- property: property,
- expected: schema[attribute],
- actual: actual,
- message: message
- });
- };
-
- function isArray(value) {
- var s = typeof value;
- if (s === 'object') {
- if (value) {
- if (typeof value.length === 'number' &&
- !(value.propertyIsEnumerable('length')) &&
- typeof value.splice === 'function') {
- return true;
- }
- }
- }
- return false;
- }
-
- function isDate(value) {
- var s = typeof value;
- if (s === 'object') {
- if (value) {
- if (typeof value.getTime === 'function') {
- return true;
- }
- }
- }
-
- return false;
- }
-
-})(typeof module === 'object' && module && module.exports ? module.exports : window);
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/package.json b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/package.json
deleted file mode 100644
index b1585d3f0..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/package.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "name": "revalidator",
- "version": "0.1.8",
- "description": "A cross-browser / node.js validator used by resourceful",
- "license": "Apache 2.0",
- "author": {
- "name": "Nodejitsu Inc.",
- "email": "info@nodejitsu.com"
- },
- "maintainers": [
- {
- "name": "indexzero",
- "email": "charlie.robbins@gmail.com"
- },
- {
- "name": "fedor.indutny",
- "email": "fedor.indutny@gmail.com"
- },
- {
- "name": "julianduque",
- "email": "julianduquej@gmail.com"
- }
- ],
- "repository": {
- "type": "git",
- "url": "http://github.com/flatiron/revalidator.git"
- },
- "devDependencies": {
- "vows": "0.7.0"
- },
- "main": "./lib/revalidator",
- "scripts": {
- "test": "vows test/*-test.js --spec"
- },
- "engines": {
- "node": ">= 0.4.0"
- },
- "bugs": {
- "url": "https://github.com/flatiron/revalidator/issues"
- },
- "homepage": "https://github.com/flatiron/revalidator",
- "_id": "revalidator@0.1.8",
- "_shasum": "fece61bfa0c1b52a206bd6b18198184bdd523a3b",
- "_from": "revalidator@0.1.x",
- "_npmVersion": "1.4.10",
- "_npmUser": {
- "name": "julianduque",
- "email": "julianduquej@gmail.com"
- },
- "dist": {
- "shasum": "fece61bfa0c1b52a206bd6b18198184bdd523a3b",
- "tarball": "http://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz",
- "readme": "ERROR: No README data found!"
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/test/validator-test.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/test/validator-test.js
deleted file mode 100644
index 6d962c28a..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/revalidator/test/validator-test.js
+++ /dev/null
@@ -1,421 +0,0 @@
-var assert = require('assert'),
- vows = require('vows'),
- revalidator = require('../lib/revalidator');
-
-function clone(object) {
- return Object.keys(object).reduce(function (obj, k) {
- obj[k] = object[k];
- return obj;
- }, {});
-};
-
-
-function assertInvalid(res) {
- assert.isObject(res);
- assert.strictEqual(res.valid, false);
-}
-
-function assertValid(res) {
- assert.isObject(res);
- assert.strictEqual(res.valid, true);
-}
-
-function assertHasError(attr, field) {
- return function (res) {
- assert.notEqual(res.errors.length, 0);
- assert.ok(res.errors.some(function (e) {
- return e.attribute === attr && (field ? e.property === field : true);
- }));
- };
-}
-
-function assertHasErrorMsg(attr, msg) {
- return function (res) {
- assert.notEqual(res.errors.length, 0);
- assert.ok(res.errors.some(function (e) {
- return e.attribute === attr && e.message === msg;
- }));
- };
-}
-
-function assertValidates(passingValue, failingValue, attributes) {
- var schema = {
- name: 'Resource',
- properties: { field: {} }
- };
-
- var failing;
-
- if (!attributes) {
- attributes = failingValue;
- failing = false;
- } else {
- failing = true;
- }
-
- var attr = Object.keys(attributes)[0];
- revalidator.mixin(schema.properties.field, attributes);
-
- var result = {
- "when the object conforms": {
- topic: function () {
- return revalidator.validate({ field: passingValue }, schema);
- },
- "return an object with `valid` set to true": assertValid
- }
- };
-
- if (failing) {
- result["when the object does not conform"] ={
- topic: function () {
- return revalidator.validate({ field: failingValue }, schema);
- },
- "return an object with `valid` set to false": assertInvalid,
- "and an error concerning the attribute": assertHasError(Object.keys(attributes)[0], 'field')
- };
- };
-
- return result;
-}
-
-vows.describe('revalidator', {
- "Validating": {
- "with :'string'": assertValidates ('hello', 42, { type: "string" }),
- "with :'number'": assertValidates (42, 'hello', { type: "number" }),
- "with :'integer'": assertValidates (42, 42.5, { type: "integer" }),
- "with :'array'": assertValidates ([4, 2], 'hi', { type: "array" }),
- "with :'object'": assertValidates ({}, [], { type: "object" }),
- "with :'boolean'": assertValidates (false, 42, { type: "boolean" }),
- "with :bool,num": assertValidates (false, 'hello', { type: ["boolean", "number"] }),
- "with :bool,num": assertValidates (544, null, { type: ["boolean", "number"] }),
- "with :'null'": assertValidates (null, false, { type: "null" }),
- "with :'any'": assertValidates (9, { type: "any" }),
- "with :'date'": assertValidates (new Date(), 'hello', { type: "date" }),
- "with ": assertValidates ("kaboom", "42", { pattern: /^[a-z]+$/ }),
- "with ": assertValidates ("boom", "kaboom", { maxLength: 4 }),
- "with ": assertValidates ("kaboom", "boom", { minLength: 6 }),
- "with ": assertValidates ("hello", "", { allowEmpty: false }),
- "with ": assertValidates ( 512, 43, { minimum: 473 }),
- "with ": assertValidates ( 512, 1949, { maximum: 678 }),
- "with ": assertValidates ( 10, 9, { divisibleBy: 5 }),
- "with decimal": assertValidates ( 0.2, 0.009, { divisibleBy: 0.01 }),
- "with ": assertValidates ("orange", "cigar", { enum: ["orange", "apple", "pear"] }),
- "with :'url'": assertValidates ('http://test.com/', 'hello', { format: 'url' }),
- "with ": {
- topic: {
- properties: {
- town: { dependencies: "country" },
- country: { }
- }
- },
- "when the object conforms": {
- topic: function (schema) {
- return revalidator.validate({ town: "luna", country: "moon" }, schema);
- },
- "return an object with `valid` set to true": assertValid
- },
- "when the object does not conform": {
- topic: function (schema) {
- return revalidator.validate({ town: "luna" }, schema);
- },
- "return an object with `valid` set to false": assertInvalid,
- "and an error concerning the attribute": assertHasError('dependencies')
- }
- },
- "with as array": {
- topic: {
- properties: {
- town: { dependencies: ["country", "planet"] },
- country: { },
- planet: { }
- }
- },
- "when the object conforms": {
- topic: function (schema) {
- return revalidator.validate({ town: "luna", country: "moon", planet: "mars" }, schema);
- },
- "return an object with `valid` set to true": assertValid
- },
- "when the object does not conform": {
- topic: function (schema) {
- return revalidator.validate({ town: "luna", planet: "mars" }, schema);
- },
- "return an object with `valid` set to false": assertInvalid,
- "and an error concerning the attribute": assertHasError('dependencies')
- }
- },
- "with as schema": {
- topic: {
- properties: {
- town: {
- type: 'string',
- dependencies: {
- properties: { x: { type: "number" } }
- }
- },
- country: { }
- }
- },
- "when the object conforms": {
- topic: function (schema) {
- return revalidator.validate({ town: "luna", x: 1 }, schema);
- },
- "return an object with `valid` set to true": assertValid,
- },
- "when the object does not conform": {
- topic: function (schema) {
- return revalidator.validate({ town: "luna", x: 'no' }, schema);
- },
- "return an object with `valid` set to false": assertInvalid
- }
- },
- "with :'integer' and": {
- " constraints": assertValidates ( 512, 43, { minimum: 473, type: 'integer' }),
- " constraints": assertValidates ( 512, 1949, { maximum: 678, type: 'integer' }),
- " constraints": assertValidates ( 10, 9, { divisibleBy: 5, type: 'integer' })
- },
- "with :false": {
- topic: {
- properties: {
- town: { type: 'string' }
- },
- additionalProperties: false
- },
- "when the object conforms": {
- topic: function (schema) {
- return revalidator.validate({ town: "luna" }, schema);
- },
- "return an object with `valid` set to true": assertValid
- },
- "when the object does not conform": {
- topic: function (schema) {
- return revalidator.validate({ town: "luna", area: 'park' }, schema);
- },
- "return an object with `valid` set to false": assertInvalid
- }
- }
- }
-}).addBatch({
- "A schema": {
- topic: {
- name: 'Article',
- properties: {
- title: {
- type: 'string',
- maxLength: 140,
- conditions: {
- optional: function () {
- return !this.published;
- }
- }
- },
- date: { type: 'string', format: 'date', messages: { format: "must be a valid %{expected} and nothing else" } },
- body: { type: 'string' },
- tags: {
- type: 'array',
- uniqueItems: true,
- minItems: 2,
- items: {
- type: 'string',
- pattern: /[a-z ]+/
- }
- },
- tuple: {
- type: 'array',
- minItems: 2,
- maxItems: 2,
- items: {
- type: ['string', 'number']
- }
- },
- author: { type: 'string', pattern: /^[\w ]+$/i, required: true, messages: { required: "is essential for survival" } },
- published: { type: 'boolean', 'default': false },
- category: { type: 'string' },
- palindrome: {type: 'string', conform: function(val) {
- return val == val.split("").reverse().join(""); }
- },
- name: { type: 'string', default: '', conform: function(val, data) {
- return (val === data.author); }
- }
- },
- patternProperties: {
- '^_': {
- type: 'boolean', default: false
- }
- }
- },
- "and an object": {
- topic: {
- title: 'Gimme some Gurus',
- date: '2012-02-04',
- body: "And I will pwn your codex.",
- tags: ['energy drinks', 'code'],
- tuple: ['string0', 103],
- author: 'cloudhead',
- published: true,
- category: 'misc',
- palindrome: 'dennis sinned',
- name: 'cloudhead',
- _flag: true
- },
- "can be validated with `revalidator.validate`": {
- "and if it conforms": {
- topic: function (object, schema) {
- return revalidator.validate(object, schema);
- },
- "return an object with the `valid` property set to true": assertValid,
- "return an object with the `errors` property as an empty array": function (res) {
- assert.isArray(res.errors);
- assert.isEmpty(res.errors);
- }
- },
- "and if it has a missing required property": {
- topic: function (object, schema) {
- object = clone(object);
- delete object.author;
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertInvalid,
- "and an error concerning the 'required' attribute": assertHasError('required'),
- "and the error message defined": assertHasErrorMsg('required', "is essential for survival")
- },
- "and if it has a missing non-required property": {
- topic: function (object, schema) {
- object = clone(object);
- delete object.category;
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertValid
- },
- "and if it has a incorrect pattern property": {
- topic: function (object, schema) {
- object = clone(object);
- object._additionalFlag = 'text';
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertInvalid
- },
- "and if it has a incorrect unique array property": {
- topic: function (object, schema) {
- object = clone(object);
- object.tags = ['a', 'a'];
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertInvalid
- },
- "and if it has a incorrect array property (wrong values)": {
- topic: function (object, schema) {
- object = clone(object);
- object.tags = ['a', '____'];
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertInvalid
- },
- "and if it has a incorrect array property (< minItems)": {
- topic: function (object, schema) {
- object = clone(object);
- object.tags = ['x'];
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertInvalid
- },
- "and if it has a incorrect format (date)": {
- topic: function (object, schema) {
- object = clone(object);
- object.date = 'bad date';
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertInvalid,
- "and the error message defined": assertHasErrorMsg('format', "must be a valid date and nothing else")
- },
- "and if it is not a palindrome (conform function)": {
- topic: function (object, schema) {
- object = clone(object);
- object.palindrome = 'bad palindrome';
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertInvalid
- },
- "and if it didn't validate a pattern": {
- topic: function (object, schema) {
- object = clone(object);
- object.author = 'email@address.com';
- return revalidator.validate(object, schema);
- },
- "return an object with `valid` set to false": assertInvalid,
- "and an error concerning the 'pattern' attribute": assertHasError('pattern')
- },
- }
- },
- "with option": {
- topic: {
- properties: {
- answer: { type: "integer" },
- is_ready: { type: "boolean" }
- }
- },
- "and property": {
- "is castable string": {
- topic: function (schema) {
- return revalidator.validate({ answer: "42" }, schema, { cast: true });
- },
- "return an object with `valid` set to true": assertValid
- },
- "is uncastable string": {
- topic: function (schema) {
- return revalidator.validate({ answer: "forty2" }, schema, { cast: true });
- },
- "return an object with `valid` set to false": assertInvalid
- },
- "is casted to integer": {
- topic: function (schema) {
- var object = { answer: "42" };
- revalidator.validate(object, schema, { cast: true });
- return object;
- },
- "return an object with `answer` set to 42": function(res) { assert.strictEqual(res.answer, 42) }
- }
- },
- "and property": {
- "is castable 'true/false' string": {
- topic: function (schema) {
- return revalidator.validate({ is_ready: "true" }, schema, { cast: true });
- },
- "return an object with `valid` set to true": assertValid
- },
- "is castable '1/0' string": {
- topic: function (schema) {
- return revalidator.validate({ is_ready: "1" }, schema, { cast: true });
- },
- "return an object with `valid` set to true": assertValid
- },
- "is castable `1/0` integer": {
- topic: function (schema) {
- return revalidator.validate({ is_ready: 1 }, schema, { cast: true });
- },
- "return an object with `valid` set to true": assertValid
- },
- "is uncastable string": {
- topic: function (schema) {
- return revalidator.validate({ is_ready: "not yet" }, schema, { cast: true });
- },
- "return an object with `valid` set to false": assertInvalid
- },
- "is uncastable number": {
- topic: function (schema) {
- return revalidator.validate({ is_ready: 42 }, schema, { cast: true });
- },
- "return an object with `valid` set to false": assertInvalid
- },
- "is casted to boolean": {
- topic: function (schema) {
- var object = { is_ready: "true" };
- revalidator.validate(object, schema, { cast: true });
- return object;
- },
- "return an object with `is_ready` set to true": function(res) { assert.strictEqual(res.is_ready, true) }
- }
- }
- }
- }
-}).export(module);
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/.npmignore b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/.npmignore
deleted file mode 100644
index 8d8bfd57b..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/.npmignore
+++ /dev/null
@@ -1,4 +0,0 @@
-node_modules
-npm-debug.log
-*.swp
-*.swo
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/.travis.yml b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/.travis.yml
deleted file mode 100644
index 88cf1f3a1..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-language: node_js
-node_js:
- - 0.6
- - 0.8
-
-notifications:
- email:
- - travis@nodejitsu.com
- irc: "irc.freenode.org#nodejitsu"
-
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/CHANGELOG.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/CHANGELOG.md
deleted file mode 100644
index b4e427a38..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/CHANGELOG.md
+++ /dev/null
@@ -1,16 +0,0 @@
-
-0.1.5 / 2012-09-18
-==================
-
- * Fixed problem with underscore values in camelToUnderscore
-
-0.1.4 / 2012-07-26
-==================
-
- * Made use of inflect for camel to underscore conversion
-
-0.1.3 / 2012-07-25
-==================
-
- * Added camel to underscore conversion and vice-versa
-
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/LICENSE b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/LICENSE
deleted file mode 100644
index 56217cac7..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2010 Nodejitsu Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/README.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/README.md
deleted file mode 100644
index 451b1fce2..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-# utile [](http://travis-ci.org/flatiron/utile)
-
-A drop-in replacement for `util` with some additional advantageous functions
-
-## Motivation
-Javascript is definitely a "batteries not included language" when compared to languages like Ruby or Python. Node.js has a simple utility library which exposes some basic (but important) functionality:
-
-```
-$ node
-> var util = require('util');
-> util.
-(...)
-
-util.debug util.error util.exec util.inherits util.inspect
-util.log util.p util.print util.pump util.puts
-```
-
-When one considers their own utility library, why ever bother requiring `util` again? That is the approach taken by this module. To compare:
-
-```
-$ node
-> var utile = require('./lib')
-> utile.
-(...)
-
-utile.async utile.capitalize utile.clone utile.cpr utile.createPath utile.debug
-utile.each utile.error utile.exec utile.file utile.filter utile.find
-utile.inherits utile.log utile.mixin utile.mkdirp utile.p utile.path
-utile.print utile.pump utile.puts utile.randomString utile.requireDir uile.requireDirLazy
-utile.rimraf
-```
-
-As you can see all of the original methods from `util` are there, but there are several new methods specific to `utile`. A note about implementation: _no node.js native modules are modified by utile, it simply copies those methods._
-
-## Methods
-The `utile` modules exposes some simple utility methods:
-
-* `.each(obj, iterator)`: Iterate over the keys of an object.
-* `.mixin(target [source0, source1, ...])`: Copies enumerable properties from `source0 ... sourceN` onto `target` and returns the resulting object.
-* `.clone(obj)`: Shallow clones the specified object.
-* `.capitalize(str)`: Capitalizes the specified `str`.
-* `.randomString(length)`: randomString returns a pseudo-random ASCII string (subset) the return value is a string of length ⌈bits/6⌉ of characters from the base64 alphabet.
-* `.filter(obj, test)`: return an object with the properties that `test` returns true on.
-* `.args(arguments)`: Converts function arguments into actual array with special `callback`, `cb`, `array`, and `last` properties. Also supports *optional* argument contracts. See [the example](https://github.com/flatiron/utile/blob/master/examples/utile-args.js) for more details.
-* `.requireDir(directory)`: Requires all files and directories from `directory`, returning an object with keys being filenames (without trailing `.js`) and respective values being return values of `require(filename)`.
-* `.requireDirLazy(directory)`: Lazily requires all files and directories from `directory`, returning an object with keys being filenames (without trailing `.js`) and respective values (getters) being return values of `require(filename)`.
-* `.format([string] text, [array] formats, [array] replacements)`: Replace `formats` in `text` with `replacements`. This will fall back to the original `util.format` command if it is called improperly.
-
-## Packaged Dependencies
-In addition to the methods that are built-in, utile includes a number of commonly used dependencies to reduce the number of includes in your package.json. These modules _are not eagerly loaded to be respectful of startup time,_ but instead are lazy-loaded getters on the `utile` object
-
-* `.async`: [Async utilities for node and the browser][0]
-* `.inflect`: [Customizable inflections for node.js][6]
-* `.mkdirp`: [Recursively mkdir, like mkdir -p, but in node.js][1]
-* `.rimraf`: [A rm -rf util for nodejs][2]
-* `.cpr`: [Asynchronous recursive file copying with Node.js][3]
-
-## Installation
-
-### Installing npm (node package manager)
-```
- curl http://npmjs.org/install.sh | sh
-```
-
-### Installing utile
-```
- [sudo] npm install utile
-```
-
-## Tests
-All tests are written with [vows][4] and should be run with [npm][5]:
-
-``` bash
- $ npm test
-```
-
-#### Author: [Nodejitsu Inc.](http://www.nodejitsu.com)
-#### Contributors: [Charlie Robbins](http://github.com/indexzero), [Dominic Tarr](http://github.com/dominictarr)
-#### License: MIT
-
-[0]: https://github.com/caolan/async
-[1]: https://github.com/substack/node-mkdirp
-[2]: https://github.com/isaacs/rimraf
-[3]: https://github.com/avianflu/ncp
-[4]: https://vowsjs.org
-[5]: https://npmjs.org
-[6]: https://github.com/pksunkara/inflect
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/args.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/args.js
deleted file mode 100644
index 34f1c1152..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/args.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * args.js: function argument parsing helper utility
- *
- * (C) 2012, Nodejitsu Inc.
- * MIT LICENSE
- *
- */
-
-var utile = require('./index');
-
-//
-// ### function args(_args)
-// #### _args {Arguments} Original function arguments
-//
-// Top-level method will accept a javascript "arguments" object (the actual keyword
-// "arguments" inside any scope), and attempt to return back an intelligent object
-// representing the functions arguments
-//
-module.exports = function (_args) {
- var args = utile.rargs(_args),
- _cb;
-
- //
- // Find and define the first argument
- //
- Object.defineProperty(args, 'first', { value: args[0] });
-
- //
- // Find and define any callback
- //
- _cb = args[args.length - 1] || args[args.length];
- if (typeof _cb === "function") {
- Object.defineProperty(args, 'callback', { value: _cb });
- Object.defineProperty(args, 'cb', { value: _cb });
- args.pop();
- }
-
- //
- // Find and define the last argument
- //
- if (args.length) {
- Object.defineProperty(args, 'last', { value: args[args.length - 1] });
- }
-
- return args;
-};
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/base64.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/base64.js
deleted file mode 100644
index 1de7a76d0..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/base64.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers
- *
- * (C) 2010, Nodejitsu Inc.
- *
- */
-
-var base64 = exports;
-
-//
-// ### function encode (unencoded)
-// #### @unencoded {string} The string to base64 encode
-// Encodes the specified string to base64 using node.js Buffers.
-//
-base64.encode = function (unencoded) {
- var encoded;
-
- try {
- encoded = new Buffer(unencoded || '').toString('base64');
- }
- catch (ex) {
- return null;
- }
-
- return encoded;
-};
-
-//
-// ### function decode (encoded)
-// #### @encoded {string} The string to base64 decode
-// Decodes the specified string from base64 using node.js Buffers.
-//
-base64.decode = function (encoded) {
- var decoded;
-
- try {
- decoded = new Buffer(encoded || '', 'base64').toString('utf8');
- }
- catch (ex) {
- return null;
- }
-
- return decoded;
-};
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/file.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/file.js
deleted file mode 100644
index 46418780e..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/file.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * file.js: Simple utilities for working with the file system.
- *
- * (C) 2011, Nodejitsu Inc.
- * MIT LICENSE
- *
- */
-
-var fs = require('fs');
-
-exports.readJson = exports.readJSON = function (file, callback) {
- if (typeof callback !== 'function') {
- throw new Error('utile.file.readJson needs a callback');
- }
-
- fs.readFile(file, 'utf-8', function (err, data) {
- if (err) {
- return callback(err);
- }
-
- try {
- var json = JSON.parse(data);
- callback(null, json);
- }
- catch (err) {
- return callback(err);
- }
- });
-};
-
-exports.readJsonSync = exports.readJSONSync = function (file) {
- return JSON.parse(fs.readFileSync(file, 'utf-8'));
-};
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/format.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/format.js
deleted file mode 100644
index 3262dd51f..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/format.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * format.js: `util.format` enhancement to allow custom formatting parameters.
- *
- * (C) 2012, Nodejitsu Inc.
- * MIT LICENSE
- *
- */
-
-var util = require('util');
-
-exports = module.exports = function(str) {
- var formats = [].slice.call(arguments, 1, 3);
-
- if (!(formats[0] instanceof Array && formats[1] instanceof Array) || arguments.length > 3)
- return util.format.apply(null, arguments);
-
- var replacements = formats.pop(),
- formats = formats.shift();
-
- formats.forEach(function(format, id) {
- str = str.replace(new RegExp(format), replacements[id]);
- });
-
- return str;
-};
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/index.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/index.js
deleted file mode 100644
index ac9f9250d..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/lib/index.js
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * index.js: Top-level include for the `utile` module.
- *
- * (C) 2011, Nodejitsu Inc.
- * MIT LICENSE
- *
- */
-
-var fs = require('fs'),
- path = require('path'),
- util = require('util');
-
-var utile = module.exports;
-
-//
-// Extend the `utile` object with all methods from the
-// core node `util` methods.
-//
-Object.keys(util).forEach(function (key) {
- utile[key] = util[key];
-});
-
-Object.defineProperties(utile, {
-
- //
- // ### function async
- // Simple wrapper to `require('async')`.
- //
- 'async': {
- get: function() {
- return utile.async = require('async');
- }
- },
-
- //
- // ### function inflect
- // Simple wrapper to `require('i')`.
- //
- 'inflect': {
- get: function() {
- return utile.inflect = require('i')();
- }
- },
-
- //
- // ### function mkdirp
- // Simple wrapper to `require('mkdirp')`
- //
- 'mkdirp': {
- get: function() {
- return utile.mkdirp = require('mkdirp');
- }
- },
-
- //
- // ### function deepEqual
- // Simple wrapper to `require('deep-equal')`
- // Remark: deepEqual is 4x faster then using assert.deepEqual
- // see: https://gist.github.com/2790507
- //
- 'deepEqual': {
- get: function() {
- return utile.deepEqual = require('deep-equal');
- }
- },
-
- //
- // ### function rimraf
- // Simple wrapper to `require('rimraf')`
- //
- 'rimraf': {
- get: function() {
- return utile.rimraf = require('rimraf');
- }
- },
-
- //
- // ### function cpr
- // Simple wrapper to `require('ncp').ncp`
- //
- 'cpr': {
- get: function() {
- return utile.cpr = require('ncp').ncp;
- }
- },
-
- //
- // ### @file {Object}
- // Lazy-loaded `file` module
- //
- 'file': {
- get: function() {
- return utile.file = require('./file');
- }
- },
-
- //
- // ### @args {Object}
- // Lazy-loaded `args` module
- //
- 'args': {
- get: function() {
- return utile.args = require('./args');
- }
- },
-
- //
- // ### @base64 {Object}
- // Lazy-loaded `base64` object
- //
- 'base64': {
- get: function() {
- return utile.base64 = require('./base64');
- }
- },
-
- //
- // ### @format {Object}
- // Lazy-loaded `format` object
- //
- 'format': {
- get: function() {
- return utile.format = require('./format');
- }
- }
-
-});
-
-
-//
-// ### function rargs(_args)
-// #### _args {Arguments} Original function arguments
-//
-// Top-level method will accept a javascript "arguments" object
-// (the actual keyword "arguments" inside any scope) and return
-// back an Array.
-//
-utile.rargs = function (_args, slice) {
- if (!slice) {
- slice = 0;
- }
-
- var len = (_args || []).length,
- args = new Array(len - slice),
- i;
-
- //
- // Convert the raw `_args` to a proper Array.
- //
- for (i = slice; i < len; i++) {
- args[i - slice] = _args[i];
- }
-
- return args;
-};
-
-//
-// ### function each (obj, iterator)
-// #### @obj {Object} Object to iterate over
-// #### @iterator {function} Continuation to use on each key. `function (value, key, object)`
-// Iterate over the keys of an object.
-//
-utile.each = function (obj, iterator) {
- Object.keys(obj).forEach(function (key) {
- iterator(obj[key], key, obj);
- });
-};
-
-//
-// ### function find (o)
-//
-//
-utile.find = function (obj, pred) {
- var value, key;
-
- for (key in obj) {
- value = obj[key];
- if (pred(value, key)) {
- return value;
- }
- }
-};
-
-//
-// ### function pad (str, len, chr)
-// ### @str {String} String to pad
-// ### @len {Number} Number of chars to pad str with
-// ### @chr {String} Optional replacement character, defaults to empty space
-// Appends chr to str until it reaches a length of len
-//
-utile.pad = function pad(str, len, chr) {
- var s;
- if (!chr) {
- chr = ' ';
- }
- str = str || '';
- s = str;
- if (str.length < len) {
- for (var i = 0; i < (len - str.length); i++) {
- s += chr;
- }
- }
- return s;
-}
-
-//
-// ### function path (obj, path, value)
-// ### @obj {Object} Object to insert value into
-// ### @path {Array} List of nested keys to insert value at
-// Retreives a value from given Object, `obj`, located at the
-// nested keys, `path`.
-//
-utile.path = function (obj, path) {
- var key, i;
-
- for (i in path) {
- if (typeof obj === 'undefined') {
- return undefined;
- }
-
- key = path[i];
- obj = obj[key];
- }
-
- return obj;
-};
-
-//
-// ### function createPath (obj, path, value)
-// ### @obj {Object} Object to insert value into
-// ### @path {Array} List of nested keys to insert value at
-// ### @value {*} Value to insert into the object.
-// Inserts the `value` into the given Object, `obj`, creating
-// any keys in `path` along the way if necessary.
-//
-utile.createPath = function (obj, path, value) {
- var key, i;
-
- for (i in path) {
- key = path[i];
- if (!obj[key]) {
- obj[key] = ((+i + 1 === path.length) ? value : {});
- }
-
- obj = obj[key];
- }
-};
-
-//
-// ### function mixin (target [source0, source1, ...])
-// Copies enumerable properties from `source0 ... sourceN`
-// onto `target` and returns the resulting object.
-//
-utile.mixin = function (target) {
- utile.rargs(arguments, 1).forEach(function (o) {
- Object.getOwnPropertyNames(o).forEach(function(attr) {
- var getter = Object.getOwnPropertyDescriptor(o, attr).get,
- setter = Object.getOwnPropertyDescriptor(o, attr).set;
-
- if (!getter && !setter) {
- target[attr] = o[attr];
- }
- else {
- Object.defineProperty(target, attr, {
- get: getter,
- set: setter
- });
- }
- });
- });
-
- return target;
-};
-
-
-//
-// ### function capitalize (str)
-// #### @str {string} String to capitalize
-// Capitalizes the specified `str`.
-//
-utile.capitalize = utile.inflect.camelize;
-
-//
-// ### function escapeRegExp (str)
-// #### @str {string} String to be escaped
-// Escape string for use in Javascript regex
-//
-utile.escapeRegExp = function (str) {
- return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
-};
-
-//
-// ### function randomString (length)
-// #### @length {integer} The number of bits for the random base64 string returned to contain
-// randomString returns a pseude-random ASCII string (subset)
-// the return value is a string of length ⌈bits/6⌉ of characters
-// from the base64 alphabet.
-//
-utile.randomString = function (length) {
- var chars, rand, i, ret, mod, bits;
-
- chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-';
- ret = '';
- // standard 4
- mod = 4;
- // default is 16
- bits = length * mod || 64;
-
- // in v8, Math.random() yields 32 pseudo-random bits (in spidermonkey it gives 53)
- while (bits > 0) {
- // 32-bit integer
- rand = Math.floor(Math.random() * 0x100000000);
- //we use the top bits
- for (i = 26; i > 0 && bits > 0; i -= mod, bits -= mod) {
- ret += chars[0x3F & rand >>> i];
- }
- }
-
- return ret;
-};
-
-//
-// ### function filter (object, test)
-// #### @obj {Object} Object to iterate over
-// #### @pred {function} Predicate applied to each property. `function (value, key, object)`
-// Returns an object with properties from `obj` which satisfy
-// the predicate `pred`
-//
-utile.filter = function (obj, pred) {
- var copy;
- if (Array.isArray(obj)) {
- copy = [];
- utile.each(obj, function (val, key) {
- if (pred(val, key, obj)) {
- copy.push(val);
- }
- });
- }
- else {
- copy = {};
- utile.each(obj, function (val, key) {
- if (pred(val, key, obj)) {
- copy[key] = val;
- }
- });
- }
- return copy;
-};
-
-//
-// ### function requireDir (directory)
-// #### @directory {string} Directory to require
-// Requires all files and directories from `directory`, returning an object
-// with keys being filenames (without trailing `.js`) and respective values
-// being return values of `require(filename)`.
-//
-utile.requireDir = function (directory) {
- var result = {},
- files = fs.readdirSync(directory);
-
- files.forEach(function (file) {
- if (file.substr(-3) === '.js') {
- file = file.substr(0, file.length - 3);
- }
- result[file] = require(path.resolve(directory, file));
- });
- return result;
-};
-
-//
-// ### function requireDirLazy (directory)
-// #### @directory {string} Directory to require
-// Lazily requires all files and directories from `directory`, returning an
-// object with keys being filenames (without trailing `.js`) and respective
-// values (getters) being return values of `require(filename)`.
-//
-utile.requireDirLazy = function (directory) {
- var result = {},
- files = fs.readdirSync(directory);
-
- files.forEach(function (file) {
- if (file.substr(-3) === '.js') {
- file = file.substr(0, file.length - 3);
- }
- Object.defineProperty(result, file, {
- get: function() {
- return result[file] = require(path.resolve(directory, file));
- }
- });
- });
-
- return result;
-};
-
-//
-// ### function clone (object, filter)
-// #### @object {Object} Object to clone
-// #### @filter {Function} Filter to be used
-// Shallow clones the specified object.
-//
-utile.clone = function (object, filter) {
- return Object.keys(object).reduce(filter ? function (obj, k) {
- if (filter(k)) obj[k] = object[k];
- return obj;
- } : function (obj, k) {
- obj[k] = object[k];
- return obj;
- }, {});
-};
-
-//
-// ### function camelToUnderscore (obj)
-// #### @obj {Object} Object to convert keys on.
-// Converts all keys of the type `keyName` to `key_name` on the
-// specified `obj`.
-//
-utile.camelToUnderscore = function (obj) {
- if (typeof obj !== 'object' || obj === null) {
- return obj;
- }
-
- if (Array.isArray(obj)) {
- obj.forEach(utile.camelToUnderscore);
- return obj;
- }
-
- Object.keys(obj).forEach(function (key) {
- var k = utile.inflect.underscore(key);
- if (k !== key) {
- obj[k] = obj[key];
- delete obj[key];
- key = k;
- }
- utile.camelToUnderscore(obj[key]);
- });
-
- return obj;
-};
-
-//
-// ### function underscoreToCamel (obj)
-// #### @obj {Object} Object to convert keys on.
-// Converts all keys of the type `key_name` to `keyName` on the
-// specified `obj`.
-//
-utile.underscoreToCamel = function (obj) {
- if (typeof obj !== 'object' || obj === null) {
- return obj;
- }
-
- if (Array.isArray(obj)) {
- obj.forEach(utile.underscoreToCamel);
- return obj;
- }
-
- Object.keys(obj).forEach(function (key) {
- var k = utile.inflect.camelize(key, false);
- if (k !== key) {
- obj[k] = obj[key];
- delete obj[key];
- key = k;
- }
- utile.underscoreToCamel(obj[key]);
- });
-
- return obj;
-};
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/mkdirp b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/mkdirp
deleted file mode 120000
index 017896ceb..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/mkdirp
+++ /dev/null
@@ -1 +0,0 @@
-../mkdirp/bin/cmd.js
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/ncp b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/ncp
deleted file mode 120000
index 1c026480a..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/ncp
+++ /dev/null
@@ -1 +0,0 @@
-../ncp/bin/ncp
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/rimraf b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/rimraf
deleted file mode 120000
index 4cd49a49d..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/.bin/rimraf
+++ /dev/null
@@ -1 +0,0 @@
-../rimraf/bin.js
\ No newline at end of file
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/LICENSE b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/LICENSE
deleted file mode 100644
index b7f9d5001..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2010 Caolan McMahon
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/README.md b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/README.md
deleted file mode 100644
index 951f76e9f..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/README.md
+++ /dev/null
@@ -1,1425 +0,0 @@
-# Async.js
-
-Async is a utility module which provides straight-forward, powerful functions
-for working with asynchronous JavaScript. Although originally designed for
-use with [node.js](http://nodejs.org), it can also be used directly in the
-browser. Also supports [component](https://github.com/component/component).
-
-Async provides around 20 functions that include the usual 'functional'
-suspects (map, reduce, filter, each…) as well as some common patterns
-for asynchronous control flow (parallel, series, waterfall…). All these
-functions assume you follow the node.js convention of providing a single
-callback as the last argument of your async function.
-
-
-## Quick Examples
-
-```javascript
-async.map(['file1','file2','file3'], fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-
-async.filter(['file1','file2','file3'], fs.exists, function(results){
- // results now equals an array of the existing files
-});
-
-async.parallel([
- function(){ ... },
- function(){ ... }
-], callback);
-
-async.series([
- function(){ ... },
- function(){ ... }
-]);
-```
-
-There are many more functions available so take a look at the docs below for a
-full list. This module aims to be comprehensive, so if you feel anything is
-missing please create a GitHub issue for it.
-
-## Common Pitfalls
-
-### Binding a context to an iterator
-
-This section is really about bind, not about async. If you are wondering how to
-make async execute your iterators in a given context, or are confused as to why
-a method of another library isn't working as an iterator, study this example:
-
-```js
-// Here is a simple object with an (unnecessarily roundabout) squaring method
-var AsyncSquaringLibrary = {
- squareExponent: 2,
- square: function(number, callback){
- var result = Math.pow(number, this.squareExponent);
- setTimeout(function(){
- callback(null, result);
- }, 200);
- }
-};
-
-async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
- // result is [NaN, NaN, NaN]
- // This fails because the `this.squareExponent` expression in the square
- // function is not evaluated in the context of AsyncSquaringLibrary, and is
- // therefore undefined.
-});
-
-async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
- // result is [1, 4, 9]
- // With the help of bind we can attach a context to the iterator before
- // passing it to async. Now the square function will be executed in its
- // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
- // will be as expected.
-});
-```
-
-## Download
-
-The source is available for download from
-[GitHub](http://github.com/caolan/async).
-Alternatively, you can install using Node Package Manager (npm):
-
- npm install async
-
-__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
-
-## In the Browser
-
-So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:
-
-```html
-
-
-```
-
-## Documentation
-
-### Collections
-
-* [each](#each)
-* [eachSeries](#eachSeries)
-* [eachLimit](#eachLimit)
-* [map](#map)
-* [mapSeries](#mapSeries)
-* [mapLimit](#mapLimit)
-* [filter](#filter)
-* [filterSeries](#filterSeries)
-* [reject](#reject)
-* [rejectSeries](#rejectSeries)
-* [reduce](#reduce)
-* [reduceRight](#reduceRight)
-* [detect](#detect)
-* [detectSeries](#detectSeries)
-* [sortBy](#sortBy)
-* [some](#some)
-* [every](#every)
-* [concat](#concat)
-* [concatSeries](#concatSeries)
-
-### Control Flow
-
-* [series](#series)
-* [parallel](#parallel)
-* [parallelLimit](#parallellimittasks-limit-callback)
-* [whilst](#whilst)
-* [doWhilst](#doWhilst)
-* [until](#until)
-* [doUntil](#doUntil)
-* [forever](#forever)
-* [waterfall](#waterfall)
-* [compose](#compose)
-* [applyEach](#applyEach)
-* [applyEachSeries](#applyEachSeries)
-* [queue](#queue)
-* [cargo](#cargo)
-* [auto](#auto)
-* [iterator](#iterator)
-* [apply](#apply)
-* [nextTick](#nextTick)
-* [times](#times)
-* [timesSeries](#timesSeries)
-
-### Utils
-
-* [memoize](#memoize)
-* [unmemoize](#unmemoize)
-* [log](#log)
-* [dir](#dir)
-* [noConflict](#noConflict)
-
-
-## Collections
-
-
-
-### each(arr, iterator, callback)
-
-Applies an iterator function to each item in an array, in parallel.
-The iterator is called with an item from the list and a callback for when it
-has finished. If the iterator passes an error to this callback, the main
-callback for the each function is immediately called with the error.
-
-Note, that since this function applies the iterator to each item in parallel
-there is no guarantee that the iterator functions will complete in order.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err) which must be called once it has
- completed. If no error has occured, the callback should be run without
- arguments or with an explicit null argument.
-* callback(err) - A callback which is called after all the iterator functions
- have finished, or an error has occurred.
-
-__Example__
-
-```js
-// assuming openFiles is an array of file names and saveFile is a function
-// to save the modified contents of that file:
-
-async.each(openFiles, saveFile, function(err){
- // if any of the saves produced an error, err would equal that error
-});
-```
-
----------------------------------------
-
-
-
-### eachSeries(arr, iterator, callback)
-
-The same as each only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. This means the iterator functions will complete in order.
-
-
----------------------------------------
-
-
-
-### eachLimit(arr, limit, iterator, callback)
-
-The same as each only no more than "limit" iterators will be simultaneously
-running at any time.
-
-Note that the items are not processed in batches, so there is no guarantee that
- the first "limit" iterator functions will complete before any others are
-started.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* limit - The maximum number of iterators to run at any time.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err) which must be called once it has
- completed. If no error has occured, the callback should be run without
- arguments or with an explicit null argument.
-* callback(err) - A callback which is called after all the iterator functions
- have finished, or an error has occurred.
-
-__Example__
-
-```js
-// Assume documents is an array of JSON objects and requestApi is a
-// function that interacts with a rate-limited REST api.
-
-async.eachLimit(documents, 20, requestApi, function(err){
- // if any of the saves produced an error, err would equal that error
-});
-```
-
----------------------------------------
-
-
-### map(arr, iterator, callback)
-
-Produces a new array of values by mapping each value in the given array through
-the iterator function. The iterator is called with an item from the array and a
-callback for when it has finished processing. The callback takes 2 arguments,
-an error and the transformed item from the array. If the iterator passes an
-error to this callback, the main callback for the map function is immediately
-called with the error.
-
-Note, that since this function applies the iterator to each item in parallel
-there is no guarantee that the iterator functions will complete in order, however
-the results array will be in the same order as the original array.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, transformed) which must be called once
- it has completed with an error (which can be null) and a transformed item.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array of the
- transformed items from the original array.
-
-__Example__
-
-```js
-async.map(['file1','file2','file3'], fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-```
-
----------------------------------------
-
-
-### mapSeries(arr, iterator, callback)
-
-The same as map only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
-
----------------------------------------
-
-
-### mapLimit(arr, limit, iterator, callback)
-
-The same as map only no more than "limit" iterators will be simultaneously
-running at any time.
-
-Note that the items are not processed in batches, so there is no guarantee that
- the first "limit" iterator functions will complete before any others are
-started.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* limit - The maximum number of iterators to run at any time.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, transformed) which must be called once
- it has completed with an error (which can be null) and a transformed item.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array of the
- transformed items from the original array.
-
-__Example__
-
-```js
-async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-```
-
----------------------------------------
-
-
-### filter(arr, iterator, callback)
-
-__Alias:__ select
-
-Returns a new array of all the values which pass an async truth test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists. This operation is
-performed in parallel, but the results array will be in the same order as the
-original.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(results) - A callback which is called after all the iterator
- functions have finished.
-
-__Example__
-
-```js
-async.filter(['file1','file2','file3'], fs.exists, function(results){
- // results now equals an array of the existing files
-});
-```
-
----------------------------------------
-
-
-### filterSeries(arr, iterator, callback)
-
-__alias:__ selectSeries
-
-The same as filter only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
----------------------------------------
-
-
-### reject(arr, iterator, callback)
-
-The opposite of filter. Removes values that pass an async truth test.
-
----------------------------------------
-
-
-### rejectSeries(arr, iterator, callback)
-
-The same as reject, only the iterator is applied to each item in the array
-in series.
-
-
----------------------------------------
-
-
-### reduce(arr, memo, iterator, callback)
-
-__aliases:__ inject, foldl
-
-Reduces a list of values into a single value using an async iterator to return
-each successive step. Memo is the initial state of the reduction. This
-function only operates in series. For performance reasons, it may make sense to
-split a call to this function into a parallel map, then use the normal
-Array.prototype.reduce on the results. This function is for situations where
-each step in the reduction needs to be async, if you can get the data before
-reducing it then it's probably a good idea to do so.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* memo - The initial state of the reduction.
-* iterator(memo, item, callback) - A function applied to each item in the
- array to produce the next step in the reduction. The iterator is passed a
- callback(err, reduction) which accepts an optional error as its first
- argument, and the state of the reduction as the second. If an error is
- passed to the callback, the reduction is stopped and the main callback is
- immediately called with the error.
-* callback(err, result) - A callback which is called after all the iterator
- functions have finished. Result is the reduced value.
-
-__Example__
-
-```js
-async.reduce([1,2,3], 0, function(memo, item, callback){
- // pointless async:
- process.nextTick(function(){
- callback(null, memo + item)
- });
-}, function(err, result){
- // result is now equal to the last value of memo, which is 6
-});
-```
-
----------------------------------------
-
-
-### reduceRight(arr, memo, iterator, callback)
-
-__Alias:__ foldr
-
-Same as reduce, only operates on the items in the array in reverse order.
-
-
----------------------------------------
-
-
-### detect(arr, iterator, callback)
-
-Returns the first value in a list that passes an async truth test. The
-iterator is applied in parallel, meaning the first iterator to return true will
-fire the detect callback with that result. That means the result might not be
-the first item in the original array (in terms of order) that passes the test.
-
-If order within the original array is important then look at detectSeries.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called as soon as any iterator returns
- true, or after all the iterator functions have finished. Result will be
- the first item in the array that passes the truth test (iterator) or the
- value undefined if none passed.
-
-__Example__
-
-```js
-async.detect(['file1','file2','file3'], fs.exists, function(result){
- // result now equals the first file in the list that exists
-});
-```
-
----------------------------------------
-
-
-### detectSeries(arr, iterator, callback)
-
-The same as detect, only the iterator is applied to each item in the array
-in series. This means the result is always the first in the original array (in
-terms of array order) that passes the truth test.
-
-
----------------------------------------
-
-
-### sortBy(arr, iterator, callback)
-
-Sorts a list by the results of running each value through an async iterator.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, sortValue) which must be called once it
- has completed with an error (which can be null) and a value to use as the sort
- criteria.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is the items from
- the original array sorted by the values returned by the iterator calls.
-
-__Example__
-
-```js
-async.sortBy(['file1','file2','file3'], function(file, callback){
- fs.stat(file, function(err, stats){
- callback(err, stats.mtime);
- });
-}, function(err, results){
- // results is now the original array of files sorted by
- // modified date
-});
-```
-
----------------------------------------
-
-
-### some(arr, iterator, callback)
-
-__Alias:__ any
-
-Returns true if at least one element in the array satisfies an async test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists. Once any iterator
-call returns true, the main callback is immediately called.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called as soon as any iterator returns
- true, or after all the iterator functions have finished. Result will be
- either true or false depending on the values of the async tests.
-
-__Example__
-
-```js
-async.some(['file1','file2','file3'], fs.exists, function(result){
- // if result is true then at least one of the files exists
-});
-```
-
----------------------------------------
-
-
-### every(arr, iterator, callback)
-
-__Alias:__ all
-
-Returns true if every element in the array satisfies an async test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called after all the iterator
- functions have finished. Result will be either true or false depending on
- the values of the async tests.
-
-__Example__
-
-```js
-async.every(['file1','file2','file3'], fs.exists, function(result){
- // if result is true then every file exists
-});
-```
-
----------------------------------------
-
-
-### concat(arr, iterator, callback)
-
-Applies an iterator to each item in a list, concatenating the results. Returns the
-concatenated list. The iterators are called in parallel, and the results are
-concatenated as they return. There is no guarantee that the results array will
-be returned in the original order of the arguments passed to the iterator function.
-
-__Arguments__
-
-* arr - An array to iterate over
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, results) which must be called once it
- has completed with an error (which can be null) and an array of results.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array containing
- the concatenated results of the iterator function.
-
-__Example__
-
-```js
-async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
- // files is now a list of filenames that exist in the 3 directories
-});
-```
-
----------------------------------------
-
-
-### concatSeries(arr, iterator, callback)
-
-Same as async.concat, but executes in series instead of parallel.
-
-
-## Control Flow
-
-
-### series(tasks, [callback])
-
-Run an array of functions in series, each one running once the previous
-function has completed. If any functions in the series pass an error to its
-callback, no more functions are run and the callback for the series is
-immediately called with the value of the error. Once the tasks have completed,
-the results are passed to the final callback as an array.
-
-It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final callback as an object
-instead of an array. This can be a more readable way of handling results from
-async.series.
-
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
-__Example__
-
-```js
-async.series([
- function(callback){
- // do some stuff ...
- callback(null, 'one');
- },
- function(callback){
- // do some more stuff ...
- callback(null, 'two');
- }
-],
-// optional callback
-function(err, results){
- // results is now equal to ['one', 'two']
-});
-
-
-// an example using an object instead of an array
-async.series({
- one: function(callback){
- setTimeout(function(){
- callback(null, 1);
- }, 200);
- },
- two: function(callback){
- setTimeout(function(){
- callback(null, 2);
- }, 100);
- }
-},
-function(err, results) {
- // results is now equal to: {one: 1, two: 2}
-});
-```
-
----------------------------------------
-
-
-### parallel(tasks, [callback])
-
-Run an array of functions in parallel, without waiting until the previous
-function has completed. If any of the functions pass an error to its
-callback, the main callback is immediately called with the value of the error.
-Once the tasks have completed, the results are passed to the final callback as an
-array.
-
-It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final callback as an object
-instead of an array. This can be a more readable way of handling results from
-async.parallel.
-
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
-__Example__
-
-```js
-async.parallel([
- function(callback){
- setTimeout(function(){
- callback(null, 'one');
- }, 200);
- },
- function(callback){
- setTimeout(function(){
- callback(null, 'two');
- }, 100);
- }
-],
-// optional callback
-function(err, results){
- // the results array will equal ['one','two'] even though
- // the second function had a shorter timeout.
-});
-
-
-// an example using an object instead of an array
-async.parallel({
- one: function(callback){
- setTimeout(function(){
- callback(null, 1);
- }, 200);
- },
- two: function(callback){
- setTimeout(function(){
- callback(null, 2);
- }, 100);
- }
-},
-function(err, results) {
- // results is now equals to: {one: 1, two: 2}
-});
-```
-
----------------------------------------
-
-
-### parallelLimit(tasks, limit, [callback])
-
-The same as parallel only the tasks are executed in parallel with a maximum of "limit"
-tasks executing at any time.
-
-Note that the tasks are not executed in batches, so there is no guarantee that
-the first "limit" tasks will complete before any others are started.
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* limit - The maximum number of tasks to run at any time.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
----------------------------------------
-
-
-### whilst(test, fn, callback)
-
-Repeatedly call fn, while test returns true. Calls the callback when stopped,
-or an error occurs.
-
-__Arguments__
-
-* test() - synchronous truth test to perform before each execution of fn.
-* fn(callback) - A function to call each time the test passes. The function is
- passed a callback(err) which must be called once it has completed with an
- optional error argument.
-* callback(err) - A callback which is called after the test fails and repeated
- execution of fn has stopped.
-
-__Example__
-
-```js
-var count = 0;
-
-async.whilst(
- function () { return count < 5; },
- function (callback) {
- count++;
- setTimeout(callback, 1000);
- },
- function (err) {
- // 5 seconds have passed
- }
-);
-```
-
----------------------------------------
-
-
-### doWhilst(fn, test, callback)
-
-The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
-
----------------------------------------
-
-
-### until(test, fn, callback)
-
-Repeatedly call fn, until test returns true. Calls the callback when stopped,
-or an error occurs.
-
-The inverse of async.whilst.
-
----------------------------------------
-
-
-### doUntil(fn, test, callback)
-
-Like doWhilst except the test is inverted. Note the argument ordering differs from `until`.
-
----------------------------------------
-
-
-### forever(fn, callback)
-
-Calls the asynchronous function 'fn' repeatedly, in series, indefinitely.
-If an error is passed to fn's callback then 'callback' is called with the
-error, otherwise it will never be called.
-
----------------------------------------
-
-
-### waterfall(tasks, [callback])
-
-Runs an array of functions in series, each passing their results to the next in
-the array. However, if any of the functions pass an error to the callback, the
-next function is not executed and the main callback is immediately called with
-the error.
-
-__Arguments__
-
-* tasks - An array of functions to run, each function is passed a
- callback(err, result1, result2, ...) it must call on completion. The first
- argument is an error (which can be null) and any further arguments will be
- passed as arguments in order to the next task.
-* callback(err, [results]) - An optional callback to run once all the functions
- have completed. This will be passed the results of the last task's callback.
-
-
-
-__Example__
-
-```js
-async.waterfall([
- function(callback){
- callback(null, 'one', 'two');
- },
- function(arg1, arg2, callback){
- callback(null, 'three');
- },
- function(arg1, callback){
- // arg1 now equals 'three'
- callback(null, 'done');
- }
-], function (err, result) {
- // result now equals 'done'
-});
-```
-
----------------------------------------
-
-### compose(fn1, fn2...)
-
-Creates a function which is a composition of the passed asynchronous
-functions. Each function consumes the return value of the function that
-follows. Composing functions f(), g() and h() would produce the result of
-f(g(h())), only this version uses callbacks to obtain the return values.
-
-Each function is executed with the `this` binding of the composed function.
-
-__Arguments__
-
-* functions... - the asynchronous functions to compose
-
-
-__Example__
-
-```js
-function add1(n, callback) {
- setTimeout(function () {
- callback(null, n + 1);
- }, 10);
-}
-
-function mul3(n, callback) {
- setTimeout(function () {
- callback(null, n * 3);
- }, 10);
-}
-
-var add1mul3 = async.compose(mul3, add1);
-
-add1mul3(4, function (err, result) {
- // result now equals 15
-});
-```
-
----------------------------------------
-
-### applyEach(fns, args..., callback)
-
-Applies the provided arguments to each function in the array, calling the
-callback after all functions have completed. If you only provide the first
-argument then it will return a function which lets you pass in the
-arguments as if it were a single function call.
-
-__Arguments__
-
-* fns - the asynchronous functions to all call with the same arguments
-* args... - any number of separate arguments to pass to the function
-* callback - the final argument should be the callback, called when all
- functions have completed processing
-
-
-__Example__
-
-```js
-async.applyEach([enableSearch, updateSchema], 'bucket', callback);
-
-// partial application example:
-async.each(
- buckets,
- async.applyEach([enableSearch, updateSchema]),
- callback
-);
-```
-
----------------------------------------
-
-
-### applyEachSeries(arr, iterator, callback)
-
-The same as applyEach only the functions are applied in series.
-
----------------------------------------
-
-
-### queue(worker, concurrency)
-
-Creates a queue object with the specified concurrency. Tasks added to the
-queue will be processed in parallel (up to the concurrency limit). If all
-workers are in progress, the task is queued until one is available. Once
-a worker has completed a task, the task's callback is called.
-
-__Arguments__
-
-* worker(task, callback) - An asynchronous function for processing a queued
- task, which must call its callback(err) argument when finished, with an
- optional error as an argument.
-* concurrency - An integer for determining how many worker functions should be
- run in parallel.
-
-__Queue objects__
-
-The queue object returned by this function has the following properties and
-methods:
-
-* length() - a function returning the number of items waiting to be processed.
-* concurrency - an integer for determining how many worker functions should be
- run in parallel. This property can be changed after a queue is created to
- alter the concurrency on-the-fly.
-* push(task, [callback]) - add a new task to the queue, the callback is called
- once the worker has finished processing the task.
- instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
-* unshift(task, [callback]) - add a new task to the front of the queue.
-* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
-* empty - a callback that is called when the last item from the queue is given to a worker
-* drain - a callback that is called when the last item from the queue has returned from the worker
-
-__Example__
-
-```js
-// create a queue object with concurrency 2
-
-var q = async.queue(function (task, callback) {
- console.log('hello ' + task.name);
- callback();
-}, 2);
-
-
-// assign a callback
-q.drain = function() {
- console.log('all items have been processed');
-}
-
-// add some items to the queue
-
-q.push({name: 'foo'}, function (err) {
- console.log('finished processing foo');
-});
-q.push({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-
-// add some items to the queue (batch-wise)
-
-q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
- console.log('finished processing bar');
-});
-
-// add some items to the front of the queue
-
-q.unshift({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-```
-
----------------------------------------
-
-
-### cargo(worker, [payload])
-
-Creates a cargo object with the specified payload. Tasks added to the
-cargo will be processed altogether (up to the payload limit). If the
-worker is in progress, the task is queued until it is available. Once
-the worker has completed some tasks, each callback of those tasks is called.
-
-__Arguments__
-
-* worker(tasks, callback) - An asynchronous function for processing an array of
- queued tasks, which must call its callback(err) argument when finished, with
- an optional error as an argument.
-* payload - An optional integer for determining how many tasks should be
- processed per round; if omitted, the default is unlimited.
-
-__Cargo objects__
-
-The cargo object returned by this function has the following properties and
-methods:
-
-* length() - a function returning the number of items waiting to be processed.
-* payload - an integer for determining how many tasks should be
- process per round. This property can be changed after a cargo is created to
- alter the payload on-the-fly.
-* push(task, [callback]) - add a new task to the queue, the callback is called
- once the worker has finished processing the task.
- instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
-* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
-* empty - a callback that is called when the last item from the queue is given to a worker
-* drain - a callback that is called when the last item from the queue has returned from the worker
-
-__Example__
-
-```js
-// create a cargo object with payload 2
-
-var cargo = async.cargo(function (tasks, callback) {
- for(var i=0; i
-### auto(tasks, [callback])
-
-Determines the best order for running functions based on their requirements.
-Each function can optionally depend on other functions being completed first,
-and each function is run as soon as its requirements are satisfied. If any of
-the functions pass an error to their callback, that function will not complete
-(so any other functions depending on it will not run) and the main callback
-will be called immediately with the error. Functions also receive an object
-containing the results of functions which have completed so far.
-
-Note, all functions are called with a results object as a second argument,
-so it is unsafe to pass functions in the tasks object which cannot handle the
-extra argument. For example, this snippet of code:
-
-```js
-async.auto({
- readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
-}, callback);
-```
-
-will have the effect of calling readFile with the results object as the last
-argument, which will fail:
-
-```js
-fs.readFile('data.txt', 'utf-8', cb, {});
-```
-
-Instead, wrap the call to readFile in a function which does not forward the
-results object:
-
-```js
-async.auto({
- readData: function(cb, results){
- fs.readFile('data.txt', 'utf-8', cb);
- }
-}, callback);
-```
-
-__Arguments__
-
-* tasks - An object literal containing named functions or an array of
- requirements, with the function itself the last item in the array. The key
- used for each function or array is used when specifying requirements. The
- function receives two arguments: (1) a callback(err, result) which must be
- called when finished, passing an error (which can be null) and the result of
- the function's execution, and (2) a results object, containing the results of
- the previously executed functions.
-* callback(err, results) - An optional callback which is called when all the
- tasks have been completed. The callback will receive an error as an argument
- if any tasks pass an error to their callback. Results will always be passed
- but if an error occurred, no other tasks will be performed, and the results
- object will only contain partial results.
-
-
-__Example__
-
-```js
-async.auto({
- get_data: function(callback){
- // async code to get some data
- },
- make_folder: function(callback){
- // async code to create a directory to store a file in
- // this is run at the same time as getting the data
- },
- write_file: ['get_data', 'make_folder', function(callback){
- // once there is some data and the directory exists,
- // write the data to a file in the directory
- callback(null, filename);
- }],
- email_link: ['write_file', function(callback, results){
- // once the file is written let's email a link to it...
- // results.write_file contains the filename returned by write_file.
- }]
-});
-```
-
-This is a fairly trivial example, but to do this using the basic parallel and
-series functions would look like this:
-
-```js
-async.parallel([
- function(callback){
- // async code to get some data
- },
- function(callback){
- // async code to create a directory to store a file in
- // this is run at the same time as getting the data
- }
-],
-function(err, results){
- async.series([
- function(callback){
- // once there is some data and the directory exists,
- // write the data to a file in the directory
- },
- function(callback){
- // once the file is written let's email a link to it...
- }
- ]);
-});
-```
-
-For a complicated series of async tasks using the auto function makes adding
-new tasks much easier and makes the code more readable.
-
-
----------------------------------------
-
-
-### iterator(tasks)
-
-Creates an iterator function which calls the next function in the array,
-returning a continuation to call the next one after that. It's also possible to
-'peek' the next iterator by doing iterator.next().
-
-This function is used internally by the async module but can be useful when
-you want to manually control the flow of functions in series.
-
-__Arguments__
-
-* tasks - An array of functions to run.
-
-__Example__
-
-```js
-var iterator = async.iterator([
- function(){ sys.p('one'); },
- function(){ sys.p('two'); },
- function(){ sys.p('three'); }
-]);
-
-node> var iterator2 = iterator();
-'one'
-node> var iterator3 = iterator2();
-'two'
-node> iterator3();
-'three'
-node> var nextfn = iterator2.next();
-node> nextfn();
-'three'
-```
-
----------------------------------------
-
-
-### apply(function, arguments..)
-
-Creates a continuation function with some arguments already applied, a useful
-shorthand when combined with other control flow functions. Any arguments
-passed to the returned function are added to the arguments originally passed
-to apply.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to automatically apply when the
- continuation is called.
-
-__Example__
-
-```js
-// using apply
-
-async.parallel([
- async.apply(fs.writeFile, 'testfile1', 'test1'),
- async.apply(fs.writeFile, 'testfile2', 'test2'),
-]);
-
-
-// the same process without using apply
-
-async.parallel([
- function(callback){
- fs.writeFile('testfile1', 'test1', callback);
- },
- function(callback){
- fs.writeFile('testfile2', 'test2', callback);
- }
-]);
-```
-
-It's possible to pass any number of additional arguments when calling the
-continuation:
-
-```js
-node> var fn = async.apply(sys.puts, 'one');
-node> fn('two', 'three');
-one
-two
-three
-```
-
----------------------------------------
-
-
-### nextTick(callback)
-
-Calls the callback on a later loop around the event loop. In node.js this just
-calls process.nextTick, in the browser it falls back to setImmediate(callback)
-if available, otherwise setTimeout(callback, 0), which means other higher priority
-events may precede the execution of the callback.
-
-This is used internally for browser-compatibility purposes.
-
-__Arguments__
-
-* callback - The function to call on a later loop around the event loop.
-
-__Example__
-
-```js
-var call_order = [];
-async.nextTick(function(){
- call_order.push('two');
- // call_order now equals ['one','two']
-});
-call_order.push('one')
-```
-
-
-### times(n, callback)
-
-Calls the callback n times and accumulates results in the same manner
-you would use with async.map.
-
-__Arguments__
-
-* n - The number of times to run the function.
-* callback - The function to call n times.
-
-__Example__
-
-```js
-// Pretend this is some complicated async factory
-var createUser = function(id, callback) {
- callback(null, {
- id: 'user' + id
- })
-}
-// generate 5 users
-async.times(5, function(n, next){
- createUser(n, function(err, user) {
- next(err, user)
- })
-}, function(err, users) {
- // we should now have 5 users
-});
-```
-
-
-### timesSeries(n, callback)
-
-The same as times only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
-
-## Utils
-
-
-### memoize(fn, [hasher])
-
-Caches the results of an async function. When creating a hash to store function
-results against, the callback is omitted from the hash and an optional hash
-function can be used.
-
-The cache of results is exposed as the `memo` property of the function returned
-by `memoize`.
-
-__Arguments__
-
-* fn - the function you to proxy and cache results from.
-* hasher - an optional function for generating a custom hash for storing
- results, it has all the arguments applied to it apart from the callback, and
- must be synchronous.
-
-__Example__
-
-```js
-var slow_fn = function (name, callback) {
- // do something
- callback(null, result);
-};
-var fn = async.memoize(slow_fn);
-
-// fn can now be used as if it were slow_fn
-fn('some name', function () {
- // callback
-});
-```
-
-
-### unmemoize(fn)
-
-Undoes a memoized function, reverting it to the original, unmemoized
-form. Comes handy in tests.
-
-__Arguments__
-
-* fn - the memoized function
-
-
-### log(function, arguments)
-
-Logs the result of an async function to the console. Only works in node.js or
-in browsers that support console.log and console.error (such as FF and Chrome).
-If multiple arguments are returned from the async function, console.log is
-called on each argument in order.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to apply to the function.
-
-__Example__
-
-```js
-var hello = function(name, callback){
- setTimeout(function(){
- callback(null, 'hello ' + name);
- }, 1000);
-};
-```
-```js
-node> async.log(hello, 'world');
-'hello world'
-```
-
----------------------------------------
-
-
-### dir(function, arguments)
-
-Logs the result of an async function to the console using console.dir to
-display the properties of the resulting object. Only works in node.js or
-in browsers that support console.dir and console.error (such as FF and Chrome).
-If multiple arguments are returned from the async function, console.dir is
-called on each argument in order.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to apply to the function.
-
-__Example__
-
-```js
-var hello = function(name, callback){
- setTimeout(function(){
- callback(null, {hello: name});
- }, 1000);
-};
-```
-```js
-node> async.dir(hello, 'world');
-{hello: 'world'}
-```
-
----------------------------------------
-
-
-### noConflict()
-
-Changes the value of async back to its original value, returning a reference to the
-async object.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/component.json b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/component.json
deleted file mode 100644
index bbb011548..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/component.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "async",
- "repo": "caolan/async",
- "description": "Higher-order functions and common patterns for asynchronous code",
- "version": "0.1.23",
- "keywords": [],
- "dependencies": {},
- "development": {},
- "main": "lib/async.js",
- "scripts": [ "lib/async.js" ]
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js
deleted file mode 100755
index 1eebb153f..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/utile/node_modules/async/lib/async.js
+++ /dev/null
@@ -1,958 +0,0 @@
-/*global setImmediate: false, setTimeout: false, console: false */
-(function () {
-
- var async = {};
-
- // global on the server, window in the browser
- var root, previous_async;
-
- root = this;
- if (root != null) {
- previous_async = root.async;
- }
-
- async.noConflict = function () {
- root.async = previous_async;
- return async;
- };
-
- function only_once(fn) {
- var called = false;
- return function() {
- if (called) throw new Error("Callback was already called.");
- called = true;
- fn.apply(root, arguments);
- }
- }
-
- //// cross-browser compatiblity functions ////
-
- var _each = function (arr, iterator) {
- if (arr.forEach) {
- return arr.forEach(iterator);
- }
- for (var i = 0; i < arr.length; i += 1) {
- iterator(arr[i], i, arr);
- }
- };
-
- var _map = function (arr, iterator) {
- if (arr.map) {
- return arr.map(iterator);
- }
- var results = [];
- _each(arr, function (x, i, a) {
- results.push(iterator(x, i, a));
- });
- return results;
- };
-
- var _reduce = function (arr, iterator, memo) {
- if (arr.reduce) {
- return arr.reduce(iterator, memo);
- }
- _each(arr, function (x, i, a) {
- memo = iterator(memo, x, i, a);
- });
- return memo;
- };
-
- var _keys = function (obj) {
- if (Object.keys) {
- return Object.keys(obj);
- }
- var keys = [];
- for (var k in obj) {
- if (obj.hasOwnProperty(k)) {
- keys.push(k);
- }
- }
- return keys;
- };
-
- //// exported async module functions ////
-
- //// nextTick implementation with browser-compatible fallback ////
- if (typeof process === 'undefined' || !(process.nextTick)) {
- if (typeof setImmediate === 'function') {
- async.nextTick = function (fn) {
- // not a direct alias for IE10 compatibility
- setImmediate(fn);
- };
- async.setImmediate = async.nextTick;
- }
- else {
- async.nextTick = function (fn) {
- setTimeout(fn, 0);
- };
- async.setImmediate = async.nextTick;
- }
- }
- else {
- async.nextTick = process.nextTick;
- if (typeof setImmediate !== 'undefined') {
- async.setImmediate = function (fn) {
- // not a direct alias for IE10 compatibility
- setImmediate(fn);
- };
- }
- else {
- async.setImmediate = async.nextTick;
- }
- }
-
- async.each = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- _each(arr, function (x) {
- iterator(x, only_once(function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback(null);
- }
- }
- }));
- });
- };
- async.forEach = async.each;
-
- async.eachSeries = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- var iterate = function () {
- iterator(arr[completed], function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback(null);
- }
- else {
- iterate();
- }
- }
- });
- };
- iterate();
- };
- async.forEachSeries = async.eachSeries;
-
- async.eachLimit = function (arr, limit, iterator, callback) {
- var fn = _eachLimit(limit);
- fn.apply(null, [arr, iterator, callback]);
- };
- async.forEachLimit = async.eachLimit;
-
- var _eachLimit = function (limit) {
-
- return function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length || limit <= 0) {
- return callback();
- }
- var completed = 0;
- var started = 0;
- var running = 0;
-
- (function replenish () {
- if (completed >= arr.length) {
- return callback();
- }
-
- while (running < limit && started < arr.length) {
- started += 1;
- running += 1;
- iterator(arr[started - 1], function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- running -= 1;
- if (completed >= arr.length) {
- callback();
- }
- else {
- replenish();
- }
- }
- });
- }
- })();
- };
- };
-
-
- var doParallel = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.each].concat(args));
- };
- };
- var doParallelLimit = function(limit, fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [_eachLimit(limit)].concat(args));
- };
- };
- var doSeries = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.eachSeries].concat(args));
- };
- };
-
-
- var _asyncMap = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (err, v) {
- results[x.index] = v;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- };
- async.map = doParallel(_asyncMap);
- async.mapSeries = doSeries(_asyncMap);
- async.mapLimit = function (arr, limit, iterator, callback) {
- return _mapLimit(limit)(arr, iterator, callback);
- };
-
- var _mapLimit = function(limit) {
- return doParallelLimit(limit, _asyncMap);
- };
-
- // reduce only has a series version, as doing reduce in parallel won't
- // work in many situations.
- async.reduce = function (arr, memo, iterator, callback) {
- async.eachSeries(arr, function (x, callback) {
- iterator(memo, x, function (err, v) {
- memo = v;
- callback(err);
- });
- }, function (err) {
- callback(err, memo);
- });
- };
- // inject alias
- async.inject = async.reduce;
- // foldl alias
- async.foldl = async.reduce;
-
- async.reduceRight = function (arr, memo, iterator, callback) {
- var reversed = _map(arr, function (x) {
- return x;
- }).reverse();
- async.reduce(reversed, memo, iterator, callback);
- };
- // foldr alias
- async.foldr = async.reduceRight;
-
- var _filter = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (v) {
- if (v) {
- results.push(x);
- }
- callback();
- });
- }, function (err) {
- callback(_map(results.sort(function (a, b) {
- return a.index - b.index;
- }), function (x) {
- return x.value;
- }));
- });
- };
- async.filter = doParallel(_filter);
- async.filterSeries = doSeries(_filter);
- // select alias
- async.select = async.filter;
- async.selectSeries = async.filterSeries;
-
- var _reject = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (v) {
- if (!v) {
- results.push(x);
- }
- callback();
- });
- }, function (err) {
- callback(_map(results.sort(function (a, b) {
- return a.index - b.index;
- }), function (x) {
- return x.value;
- }));
- });
- };
- async.reject = doParallel(_reject);
- async.rejectSeries = doSeries(_reject);
-
- var _detect = function (eachfn, arr, iterator, main_callback) {
- eachfn(arr, function (x, callback) {
- iterator(x, function (result) {
- if (result) {
- main_callback(x);
- main_callback = function () {};
- }
- else {
- callback();
- }
- });
- }, function (err) {
- main_callback();
- });
- };
- async.detect = doParallel(_detect);
- async.detectSeries = doSeries(_detect);
-
- async.some = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
- iterator(x, function (v) {
- if (v) {
- main_callback(true);
- main_callback = function () {};
- }
- callback();
- });
- }, function (err) {
- main_callback(false);
- });
- };
- // any alias
- async.any = async.some;
-
- async.every = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
- iterator(x, function (v) {
- if (!v) {
- main_callback(false);
- main_callback = function () {};
- }
- callback();
- });
- }, function (err) {
- main_callback(true);
- });
- };
- // all alias
- async.all = async.every;
-
- async.sortBy = function (arr, iterator, callback) {
- async.map(arr, function (x, callback) {
- iterator(x, function (err, criteria) {
- if (err) {
- callback(err);
- }
- else {
- callback(null, {value: x, criteria: criteria});
- }
- });
- }, function (err, results) {
- if (err) {
- return callback(err);
- }
- else {
- var fn = function (left, right) {
- var a = left.criteria, b = right.criteria;
- return a < b ? -1 : a > b ? 1 : 0;
- };
- callback(null, _map(results.sort(fn), function (x) {
- return x.value;
- }));
- }
- });
- };
-
- async.auto = function (tasks, callback) {
- callback = callback || function () {};
- var keys = _keys(tasks);
- if (!keys.length) {
- return callback(null);
- }
-
- var results = {};
-
- var listeners = [];
- var addListener = function (fn) {
- listeners.unshift(fn);
- };
- var removeListener = function (fn) {
- for (var i = 0; i < listeners.length; i += 1) {
- if (listeners[i] === fn) {
- listeners.splice(i, 1);
- return;
- }
- }
- };
- var taskComplete = function () {
- _each(listeners.slice(0), function (fn) {
- fn();
- });
- };
-
- addListener(function () {
- if (_keys(results).length === keys.length) {
- callback(null, results);
- callback = function () {};
- }
- });
-
- _each(keys, function (k) {
- var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
- var taskCallback = function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- if (err) {
- var safeResults = {};
- _each(_keys(results), function(rkey) {
- safeResults[rkey] = results[rkey];
- });
- safeResults[k] = args;
- callback(err, safeResults);
- // stop subsequent errors hitting callback multiple times
- callback = function () {};
- }
- else {
- results[k] = args;
- async.setImmediate(taskComplete);
- }
- };
- var requires = task.slice(0, Math.abs(task.length - 1)) || [];
- var ready = function () {
- return _reduce(requires, function (a, x) {
- return (a && results.hasOwnProperty(x));
- }, true) && !results.hasOwnProperty(k);
- };
- if (ready()) {
- task[task.length - 1](taskCallback, results);
- }
- else {
- var listener = function () {
- if (ready()) {
- removeListener(listener);
- task[task.length - 1](taskCallback, results);
- }
- };
- addListener(listener);
- }
- });
- };
-
- async.waterfall = function (tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor !== Array) {
- var err = new Error('First argument to waterfall must be an array of functions');
- return callback(err);
- }
- if (!tasks.length) {
- return callback();
- }
- var wrapIterator = function (iterator) {
- return function (err) {
- if (err) {
- callback.apply(null, arguments);
- callback = function () {};
- }
- else {
- var args = Array.prototype.slice.call(arguments, 1);
- var next = iterator.next();
- if (next) {
- args.push(wrapIterator(next));
- }
- else {
- args.push(callback);
- }
- async.setImmediate(function () {
- iterator.apply(null, args);
- });
- }
- };
- };
- wrapIterator(async.iterator(tasks))();
- };
-
- var _parallel = function(eachfn, tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor === Array) {
- eachfn.map(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
- }
- }, callback);
- }
- else {
- var results = {};
- eachfn.each(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
-
- async.parallel = function (tasks, callback) {
- _parallel({ map: async.map, each: async.each }, tasks, callback);
- };
-
- async.parallelLimit = function(tasks, limit, callback) {
- _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
- };
-
- async.series = function (tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor === Array) {
- async.mapSeries(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
- }
- }, callback);
- }
- else {
- var results = {};
- async.eachSeries(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
-
- async.iterator = function (tasks) {
- var makeCallback = function (index) {
- var fn = function () {
- if (tasks.length) {
- tasks[index].apply(null, arguments);
- }
- return fn.next();
- };
- fn.next = function () {
- return (index < tasks.length - 1) ? makeCallback(index + 1): null;
- };
- return fn;
- };
- return makeCallback(0);
- };
-
- async.apply = function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
- return function () {
- return fn.apply(
- null, args.concat(Array.prototype.slice.call(arguments))
- );
- };
- };
-
- var _concat = function (eachfn, arr, fn, callback) {
- var r = [];
- eachfn(arr, function (x, cb) {
- fn(x, function (err, y) {
- r = r.concat(y || []);
- cb(err);
- });
- }, function (err) {
- callback(err, r);
- });
- };
- async.concat = doParallel(_concat);
- async.concatSeries = doSeries(_concat);
-
- async.whilst = function (test, iterator, callback) {
- if (test()) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- async.whilst(test, iterator, callback);
- });
- }
- else {
- callback();
- }
- };
-
- async.doWhilst = function (iterator, test, callback) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- if (test()) {
- async.doWhilst(iterator, test, callback);
- }
- else {
- callback();
- }
- });
- };
-
- async.until = function (test, iterator, callback) {
- if (!test()) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- async.until(test, iterator, callback);
- });
- }
- else {
- callback();
- }
- };
-
- async.doUntil = function (iterator, test, callback) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- if (!test()) {
- async.doUntil(iterator, test, callback);
- }
- else {
- callback();
- }
- });
- };
-
- async.queue = function (worker, concurrency) {
- if (concurrency === undefined) {
- concurrency = 1;
- }
- function _insert(q, data, pos, callback) {
- if(data.constructor !== Array) {
- data = [data];
- }
- _each(data, function(task) {
- var item = {
- data: task,
- callback: typeof callback === 'function' ? callback : null
- };
-
- if (pos) {
- q.tasks.unshift(item);
- } else {
- q.tasks.push(item);
- }
-
- if (q.saturated && q.tasks.length === concurrency) {
- q.saturated();
- }
- async.setImmediate(q.process);
- });
- }
-
- var workers = 0;
- var q = {
- tasks: [],
- concurrency: concurrency,
- saturated: null,
- empty: null,
- drain: null,
- push: function (data, callback) {
- _insert(q, data, false, callback);
- },
- unshift: function (data, callback) {
- _insert(q, data, true, callback);
- },
- process: function () {
- if (workers < q.concurrency && q.tasks.length) {
- var task = q.tasks.shift();
- if (q.empty && q.tasks.length === 0) {
- q.empty();
- }
- workers += 1;
- var next = function () {
- workers -= 1;
- if (task.callback) {
- task.callback.apply(task, arguments);
- }
- if (q.drain && q.tasks.length + workers === 0) {
- q.drain();
- }
- q.process();
- };
- var cb = only_once(next);
- worker(task.data, cb);
- }
- },
- length: function () {
- return q.tasks.length;
- },
- running: function () {
- return workers;
- }
- };
- return q;
- };
-
- async.cargo = function (worker, payload) {
- var working = false,
- tasks = [];
-
- var cargo = {
- tasks: tasks,
- payload: payload,
- saturated: null,
- empty: null,
- drain: null,
- push: function (data, callback) {
- if(data.constructor !== Array) {
- data = [data];
- }
- _each(data, function(task) {
- tasks.push({
- data: task,
- callback: typeof callback === 'function' ? callback : null
- });
- if (cargo.saturated && tasks.length === payload) {
- cargo.saturated();
- }
- });
- async.setImmediate(cargo.process);
- },
- process: function process() {
- if (working) return;
- if (tasks.length === 0) {
- if(cargo.drain) cargo.drain();
- return;
- }
-
- var ts = typeof payload === 'number'
- ? tasks.splice(0, payload)
- : tasks.splice(0);
-
- var ds = _map(ts, function (task) {
- return task.data;
- });
-
- if(cargo.empty) cargo.empty();
- working = true;
- worker(ds, function () {
- working = false;
-
- var args = arguments;
- _each(ts, function (data) {
- if (data.callback) {
- data.callback.apply(null, args);
- }
- });
-
- process();
- });
- },
- length: function () {
- return tasks.length;
- },
- running: function () {
- return working;
- }
- };
- return cargo;
- };
-
- var _console_fn = function (name) {
- return function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
- fn.apply(null, args.concat([function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (typeof console !== 'undefined') {
- if (err) {
- if (console.error) {
- console.error(err);
- }
- }
- else if (console[name]) {
- _each(args, function (x) {
- console[name](x);
- });
- }
- }
- }]));
- };
- };
- async.log = _console_fn('log');
- async.dir = _console_fn('dir');
- /*async.info = _console_fn('info');
- async.warn = _console_fn('warn');
- async.error = _console_fn('error');*/
-
- async.memoize = function (fn, hasher) {
- var memo = {};
- var queues = {};
- hasher = hasher || function (x) {
- return x;
- };
- var memoized = function () {
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- var key = hasher.apply(null, args);
- if (key in memo) {
- callback.apply(null, memo[key]);
- }
- else if (key in queues) {
- queues[key].push(callback);
- }
- else {
- queues[key] = [callback];
- fn.apply(null, args.concat([function () {
- memo[key] = arguments;
- var q = queues[key];
- delete queues[key];
- for (var i = 0, l = q.length; i < l; i++) {
- q[i].apply(null, arguments);
- }
- }]));
- }
- };
- memoized.memo = memo;
- memoized.unmemoized = fn;
- return memoized;
- };
-
- async.unmemoize = function (fn) {
- return function () {
- return (fn.unmemoized || fn).apply(null, arguments);
- };
- };
-
- async.times = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.map(counter, iterator, callback);
- };
-
- async.timesSeries = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.mapSeries(counter, iterator, callback);
- };
-
- async.compose = function (/* functions... */) {
- var fns = Array.prototype.reverse.call(arguments);
- return function () {
- var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- async.reduce(fns, args, function (newargs, fn, cb) {
- fn.apply(that, newargs.concat([function () {
- var err = arguments[0];
- var nextargs = Array.prototype.slice.call(arguments, 1);
- cb(err, nextargs);
- }]))
- },
- function (err, results) {
- callback.apply(that, [err].concat(results));
- });
- };
- };
-
- var _applyEach = function (eachfn, fns /*args...*/) {
- var go = function () {
- var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- return eachfn(fns, function (fn, cb) {
- fn.apply(that, args.concat([cb]));
- },
- callback);
- };
- if (arguments.length > 2) {
- var args = Array.prototype.slice.call(arguments, 2);
- return go.apply(this, args);
- }
- else {
- return go;
- }
- };
- async.applyEach = doParallel(_applyEach);
- async.applyEachSeries = doSeries(_applyEach);
-
- async.forever = function (fn, callback) {
- function next(err) {
- if (err) {
- if (callback) {
- return callback(err);
- }
- throw err;
- }
- fn(next);
- }
- next();
- };
-
- // AMD / RequireJS
- if (typeof define !== 'undefined' && define.amd) {
- define([], function () {
- return async;
- });
- }
- // Node.js
- else if (typeof module !== 'undefined' && module.exports) {
- module.exports = async;
- }
- // included directly via
-
-```
-
-## Documentation
-
-### Collections
-
-* [each](#each)
-* [eachSeries](#eachSeries)
-* [eachLimit](#eachLimit)
-* [map](#map)
-* [mapSeries](#mapSeries)
-* [mapLimit](#mapLimit)
-* [filter](#filter)
-* [filterSeries](#filterSeries)
-* [reject](#reject)
-* [rejectSeries](#rejectSeries)
-* [reduce](#reduce)
-* [reduceRight](#reduceRight)
-* [detect](#detect)
-* [detectSeries](#detectSeries)
-* [sortBy](#sortBy)
-* [some](#some)
-* [every](#every)
-* [concat](#concat)
-* [concatSeries](#concatSeries)
-
-### Control Flow
-
-* [series](#series)
-* [parallel](#parallel)
-* [parallelLimit](#parallellimittasks-limit-callback)
-* [whilst](#whilst)
-* [doWhilst](#doWhilst)
-* [until](#until)
-* [doUntil](#doUntil)
-* [forever](#forever)
-* [waterfall](#waterfall)
-* [compose](#compose)
-* [applyEach](#applyEach)
-* [applyEachSeries](#applyEachSeries)
-* [queue](#queue)
-* [cargo](#cargo)
-* [auto](#auto)
-* [iterator](#iterator)
-* [apply](#apply)
-* [nextTick](#nextTick)
-* [times](#times)
-* [timesSeries](#timesSeries)
-
-### Utils
-
-* [memoize](#memoize)
-* [unmemoize](#unmemoize)
-* [log](#log)
-* [dir](#dir)
-* [noConflict](#noConflict)
-
-
-## Collections
-
-
-
-### each(arr, iterator, callback)
-
-Applies an iterator function to each item in an array, in parallel.
-The iterator is called with an item from the list and a callback for when it
-has finished. If the iterator passes an error to this callback, the main
-callback for the each function is immediately called with the error.
-
-Note, that since this function applies the iterator to each item in parallel
-there is no guarantee that the iterator functions will complete in order.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err) which must be called once it has
- completed. If no error has occured, the callback should be run without
- arguments or with an explicit null argument.
-* callback(err) - A callback which is called after all the iterator functions
- have finished, or an error has occurred.
-
-__Example__
-
-```js
-// assuming openFiles is an array of file names and saveFile is a function
-// to save the modified contents of that file:
-
-async.each(openFiles, saveFile, function(err){
- // if any of the saves produced an error, err would equal that error
-});
-```
-
----------------------------------------
-
-
-
-### eachSeries(arr, iterator, callback)
-
-The same as each only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. This means the iterator functions will complete in order.
-
-
----------------------------------------
-
-
-
-### eachLimit(arr, limit, iterator, callback)
-
-The same as each only no more than "limit" iterators will be simultaneously
-running at any time.
-
-Note that the items are not processed in batches, so there is no guarantee that
- the first "limit" iterator functions will complete before any others are
-started.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* limit - The maximum number of iterators to run at any time.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err) which must be called once it has
- completed. If no error has occured, the callback should be run without
- arguments or with an explicit null argument.
-* callback(err) - A callback which is called after all the iterator functions
- have finished, or an error has occurred.
-
-__Example__
-
-```js
-// Assume documents is an array of JSON objects and requestApi is a
-// function that interacts with a rate-limited REST api.
-
-async.eachLimit(documents, 20, requestApi, function(err){
- // if any of the saves produced an error, err would equal that error
-});
-```
-
----------------------------------------
-
-
-### map(arr, iterator, callback)
-
-Produces a new array of values by mapping each value in the given array through
-the iterator function. The iterator is called with an item from the array and a
-callback for when it has finished processing. The callback takes 2 arguments,
-an error and the transformed item from the array. If the iterator passes an
-error to this callback, the main callback for the map function is immediately
-called with the error.
-
-Note, that since this function applies the iterator to each item in parallel
-there is no guarantee that the iterator functions will complete in order, however
-the results array will be in the same order as the original array.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, transformed) which must be called once
- it has completed with an error (which can be null) and a transformed item.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array of the
- transformed items from the original array.
-
-__Example__
-
-```js
-async.map(['file1','file2','file3'], fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-```
-
----------------------------------------
-
-
-### mapSeries(arr, iterator, callback)
-
-The same as map only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
-
----------------------------------------
-
-
-### mapLimit(arr, limit, iterator, callback)
-
-The same as map only no more than "limit" iterators will be simultaneously
-running at any time.
-
-Note that the items are not processed in batches, so there is no guarantee that
- the first "limit" iterator functions will complete before any others are
-started.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* limit - The maximum number of iterators to run at any time.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, transformed) which must be called once
- it has completed with an error (which can be null) and a transformed item.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array of the
- transformed items from the original array.
-
-__Example__
-
-```js
-async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-```
-
----------------------------------------
-
-
-### filter(arr, iterator, callback)
-
-__Alias:__ select
-
-Returns a new array of all the values which pass an async truth test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists. This operation is
-performed in parallel, but the results array will be in the same order as the
-original.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(results) - A callback which is called after all the iterator
- functions have finished.
-
-__Example__
-
-```js
-async.filter(['file1','file2','file3'], fs.exists, function(results){
- // results now equals an array of the existing files
-});
-```
-
----------------------------------------
-
-
-### filterSeries(arr, iterator, callback)
-
-__alias:__ selectSeries
-
-The same as filter only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
----------------------------------------
-
-
-### reject(arr, iterator, callback)
-
-The opposite of filter. Removes values that pass an async truth test.
-
----------------------------------------
-
-
-### rejectSeries(arr, iterator, callback)
-
-The same as reject, only the iterator is applied to each item in the array
-in series.
-
-
----------------------------------------
-
-
-### reduce(arr, memo, iterator, callback)
-
-__aliases:__ inject, foldl
-
-Reduces a list of values into a single value using an async iterator to return
-each successive step. Memo is the initial state of the reduction. This
-function only operates in series. For performance reasons, it may make sense to
-split a call to this function into a parallel map, then use the normal
-Array.prototype.reduce on the results. This function is for situations where
-each step in the reduction needs to be async, if you can get the data before
-reducing it then it's probably a good idea to do so.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* memo - The initial state of the reduction.
-* iterator(memo, item, callback) - A function applied to each item in the
- array to produce the next step in the reduction. The iterator is passed a
- callback(err, reduction) which accepts an optional error as its first
- argument, and the state of the reduction as the second. If an error is
- passed to the callback, the reduction is stopped and the main callback is
- immediately called with the error.
-* callback(err, result) - A callback which is called after all the iterator
- functions have finished. Result is the reduced value.
-
-__Example__
-
-```js
-async.reduce([1,2,3], 0, function(memo, item, callback){
- // pointless async:
- process.nextTick(function(){
- callback(null, memo + item)
- });
-}, function(err, result){
- // result is now equal to the last value of memo, which is 6
-});
-```
-
----------------------------------------
-
-
-### reduceRight(arr, memo, iterator, callback)
-
-__Alias:__ foldr
-
-Same as reduce, only operates on the items in the array in reverse order.
-
-
----------------------------------------
-
-
-### detect(arr, iterator, callback)
-
-Returns the first value in a list that passes an async truth test. The
-iterator is applied in parallel, meaning the first iterator to return true will
-fire the detect callback with that result. That means the result might not be
-the first item in the original array (in terms of order) that passes the test.
-
-If order within the original array is important then look at detectSeries.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called as soon as any iterator returns
- true, or after all the iterator functions have finished. Result will be
- the first item in the array that passes the truth test (iterator) or the
- value undefined if none passed.
-
-__Example__
-
-```js
-async.detect(['file1','file2','file3'], fs.exists, function(result){
- // result now equals the first file in the list that exists
-});
-```
-
----------------------------------------
-
-
-### detectSeries(arr, iterator, callback)
-
-The same as detect, only the iterator is applied to each item in the array
-in series. This means the result is always the first in the original array (in
-terms of array order) that passes the truth test.
-
-
----------------------------------------
-
-
-### sortBy(arr, iterator, callback)
-
-Sorts a list by the results of running each value through an async iterator.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, sortValue) which must be called once it
- has completed with an error (which can be null) and a value to use as the sort
- criteria.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is the items from
- the original array sorted by the values returned by the iterator calls.
-
-__Example__
-
-```js
-async.sortBy(['file1','file2','file3'], function(file, callback){
- fs.stat(file, function(err, stats){
- callback(err, stats.mtime);
- });
-}, function(err, results){
- // results is now the original array of files sorted by
- // modified date
-});
-```
-
----------------------------------------
-
-
-### some(arr, iterator, callback)
-
-__Alias:__ any
-
-Returns true if at least one element in the array satisfies an async test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists. Once any iterator
-call returns true, the main callback is immediately called.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called as soon as any iterator returns
- true, or after all the iterator functions have finished. Result will be
- either true or false depending on the values of the async tests.
-
-__Example__
-
-```js
-async.some(['file1','file2','file3'], fs.exists, function(result){
- // if result is true then at least one of the files exists
-});
-```
-
----------------------------------------
-
-
-### every(arr, iterator, callback)
-
-__Alias:__ all
-
-Returns true if every element in the array satisfies an async test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called after all the iterator
- functions have finished. Result will be either true or false depending on
- the values of the async tests.
-
-__Example__
-
-```js
-async.every(['file1','file2','file3'], fs.exists, function(result){
- // if result is true then every file exists
-});
-```
-
----------------------------------------
-
-
-### concat(arr, iterator, callback)
-
-Applies an iterator to each item in a list, concatenating the results. Returns the
-concatenated list. The iterators are called in parallel, and the results are
-concatenated as they return. There is no guarantee that the results array will
-be returned in the original order of the arguments passed to the iterator function.
-
-__Arguments__
-
-* arr - An array to iterate over
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, results) which must be called once it
- has completed with an error (which can be null) and an array of results.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array containing
- the concatenated results of the iterator function.
-
-__Example__
-
-```js
-async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
- // files is now a list of filenames that exist in the 3 directories
-});
-```
-
----------------------------------------
-
-
-### concatSeries(arr, iterator, callback)
-
-Same as async.concat, but executes in series instead of parallel.
-
-
-## Control Flow
-
-
-### series(tasks, [callback])
-
-Run an array of functions in series, each one running once the previous
-function has completed. If any functions in the series pass an error to its
-callback, no more functions are run and the callback for the series is
-immediately called with the value of the error. Once the tasks have completed,
-the results are passed to the final callback as an array.
-
-It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final callback as an object
-instead of an array. This can be a more readable way of handling results from
-async.series.
-
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
-__Example__
-
-```js
-async.series([
- function(callback){
- // do some stuff ...
- callback(null, 'one');
- },
- function(callback){
- // do some more stuff ...
- callback(null, 'two');
- }
-],
-// optional callback
-function(err, results){
- // results is now equal to ['one', 'two']
-});
-
-
-// an example using an object instead of an array
-async.series({
- one: function(callback){
- setTimeout(function(){
- callback(null, 1);
- }, 200);
- },
- two: function(callback){
- setTimeout(function(){
- callback(null, 2);
- }, 100);
- }
-},
-function(err, results) {
- // results is now equal to: {one: 1, two: 2}
-});
-```
-
----------------------------------------
-
-
-### parallel(tasks, [callback])
-
-Run an array of functions in parallel, without waiting until the previous
-function has completed. If any of the functions pass an error to its
-callback, the main callback is immediately called with the value of the error.
-Once the tasks have completed, the results are passed to the final callback as an
-array.
-
-It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final callback as an object
-instead of an array. This can be a more readable way of handling results from
-async.parallel.
-
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
-__Example__
-
-```js
-async.parallel([
- function(callback){
- setTimeout(function(){
- callback(null, 'one');
- }, 200);
- },
- function(callback){
- setTimeout(function(){
- callback(null, 'two');
- }, 100);
- }
-],
-// optional callback
-function(err, results){
- // the results array will equal ['one','two'] even though
- // the second function had a shorter timeout.
-});
-
-
-// an example using an object instead of an array
-async.parallel({
- one: function(callback){
- setTimeout(function(){
- callback(null, 1);
- }, 200);
- },
- two: function(callback){
- setTimeout(function(){
- callback(null, 2);
- }, 100);
- }
-},
-function(err, results) {
- // results is now equals to: {one: 1, two: 2}
-});
-```
-
----------------------------------------
-
-
-### parallelLimit(tasks, limit, [callback])
-
-The same as parallel only the tasks are executed in parallel with a maximum of "limit"
-tasks executing at any time.
-
-Note that the tasks are not executed in batches, so there is no guarantee that
-the first "limit" tasks will complete before any others are started.
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* limit - The maximum number of tasks to run at any time.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
----------------------------------------
-
-
-### whilst(test, fn, callback)
-
-Repeatedly call fn, while test returns true. Calls the callback when stopped,
-or an error occurs.
-
-__Arguments__
-
-* test() - synchronous truth test to perform before each execution of fn.
-* fn(callback) - A function to call each time the test passes. The function is
- passed a callback(err) which must be called once it has completed with an
- optional error argument.
-* callback(err) - A callback which is called after the test fails and repeated
- execution of fn has stopped.
-
-__Example__
-
-```js
-var count = 0;
-
-async.whilst(
- function () { return count < 5; },
- function (callback) {
- count++;
- setTimeout(callback, 1000);
- },
- function (err) {
- // 5 seconds have passed
- }
-);
-```
-
----------------------------------------
-
-
-### doWhilst(fn, test, callback)
-
-The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
-
----------------------------------------
-
-
-### until(test, fn, callback)
-
-Repeatedly call fn, until test returns true. Calls the callback when stopped,
-or an error occurs.
-
-The inverse of async.whilst.
-
----------------------------------------
-
-
-### doUntil(fn, test, callback)
-
-Like doWhilst except the test is inverted. Note the argument ordering differs from `until`.
-
----------------------------------------
-
-
-### forever(fn, callback)
-
-Calls the asynchronous function 'fn' repeatedly, in series, indefinitely.
-If an error is passed to fn's callback then 'callback' is called with the
-error, otherwise it will never be called.
-
----------------------------------------
-
-
-### waterfall(tasks, [callback])
-
-Runs an array of functions in series, each passing their results to the next in
-the array. However, if any of the functions pass an error to the callback, the
-next function is not executed and the main callback is immediately called with
-the error.
-
-__Arguments__
-
-* tasks - An array of functions to run, each function is passed a
- callback(err, result1, result2, ...) it must call on completion. The first
- argument is an error (which can be null) and any further arguments will be
- passed as arguments in order to the next task.
-* callback(err, [results]) - An optional callback to run once all the functions
- have completed. This will be passed the results of the last task's callback.
-
-
-
-__Example__
-
-```js
-async.waterfall([
- function(callback){
- callback(null, 'one', 'two');
- },
- function(arg1, arg2, callback){
- callback(null, 'three');
- },
- function(arg1, callback){
- // arg1 now equals 'three'
- callback(null, 'done');
- }
-], function (err, result) {
- // result now equals 'done'
-});
-```
-
----------------------------------------
-
-### compose(fn1, fn2...)
-
-Creates a function which is a composition of the passed asynchronous
-functions. Each function consumes the return value of the function that
-follows. Composing functions f(), g() and h() would produce the result of
-f(g(h())), only this version uses callbacks to obtain the return values.
-
-Each function is executed with the `this` binding of the composed function.
-
-__Arguments__
-
-* functions... - the asynchronous functions to compose
-
-
-__Example__
-
-```js
-function add1(n, callback) {
- setTimeout(function () {
- callback(null, n + 1);
- }, 10);
-}
-
-function mul3(n, callback) {
- setTimeout(function () {
- callback(null, n * 3);
- }, 10);
-}
-
-var add1mul3 = async.compose(mul3, add1);
-
-add1mul3(4, function (err, result) {
- // result now equals 15
-});
-```
-
----------------------------------------
-
-### applyEach(fns, args..., callback)
-
-Applies the provided arguments to each function in the array, calling the
-callback after all functions have completed. If you only provide the first
-argument then it will return a function which lets you pass in the
-arguments as if it were a single function call.
-
-__Arguments__
-
-* fns - the asynchronous functions to all call with the same arguments
-* args... - any number of separate arguments to pass to the function
-* callback - the final argument should be the callback, called when all
- functions have completed processing
-
-
-__Example__
-
-```js
-async.applyEach([enableSearch, updateSchema], 'bucket', callback);
-
-// partial application example:
-async.each(
- buckets,
- async.applyEach([enableSearch, updateSchema]),
- callback
-);
-```
-
----------------------------------------
-
-
-### applyEachSeries(arr, iterator, callback)
-
-The same as applyEach only the functions are applied in series.
-
----------------------------------------
-
-
-### queue(worker, concurrency)
-
-Creates a queue object with the specified concurrency. Tasks added to the
-queue will be processed in parallel (up to the concurrency limit). If all
-workers are in progress, the task is queued until one is available. Once
-a worker has completed a task, the task's callback is called.
-
-__Arguments__
-
-* worker(task, callback) - An asynchronous function for processing a queued
- task, which must call its callback(err) argument when finished, with an
- optional error as an argument.
-* concurrency - An integer for determining how many worker functions should be
- run in parallel.
-
-__Queue objects__
-
-The queue object returned by this function has the following properties and
-methods:
-
-* length() - a function returning the number of items waiting to be processed.
-* concurrency - an integer for determining how many worker functions should be
- run in parallel. This property can be changed after a queue is created to
- alter the concurrency on-the-fly.
-* push(task, [callback]) - add a new task to the queue, the callback is called
- once the worker has finished processing the task.
- instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
-* unshift(task, [callback]) - add a new task to the front of the queue.
-* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
-* empty - a callback that is called when the last item from the queue is given to a worker
-* drain - a callback that is called when the last item from the queue has returned from the worker
-
-__Example__
-
-```js
-// create a queue object with concurrency 2
-
-var q = async.queue(function (task, callback) {
- console.log('hello ' + task.name);
- callback();
-}, 2);
-
-
-// assign a callback
-q.drain = function() {
- console.log('all items have been processed');
-}
-
-// add some items to the queue
-
-q.push({name: 'foo'}, function (err) {
- console.log('finished processing foo');
-});
-q.push({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-
-// add some items to the queue (batch-wise)
-
-q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
- console.log('finished processing bar');
-});
-
-// add some items to the front of the queue
-
-q.unshift({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-```
-
----------------------------------------
-
-
-### cargo(worker, [payload])
-
-Creates a cargo object with the specified payload. Tasks added to the
-cargo will be processed altogether (up to the payload limit). If the
-worker is in progress, the task is queued until it is available. Once
-the worker has completed some tasks, each callback of those tasks is called.
-
-__Arguments__
-
-* worker(tasks, callback) - An asynchronous function for processing an array of
- queued tasks, which must call its callback(err) argument when finished, with
- an optional error as an argument.
-* payload - An optional integer for determining how many tasks should be
- processed per round; if omitted, the default is unlimited.
-
-__Cargo objects__
-
-The cargo object returned by this function has the following properties and
-methods:
-
-* length() - a function returning the number of items waiting to be processed.
-* payload - an integer for determining how many tasks should be
- process per round. This property can be changed after a cargo is created to
- alter the payload on-the-fly.
-* push(task, [callback]) - add a new task to the queue, the callback is called
- once the worker has finished processing the task.
- instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
-* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
-* empty - a callback that is called when the last item from the queue is given to a worker
-* drain - a callback that is called when the last item from the queue has returned from the worker
-
-__Example__
-
-```js
-// create a cargo object with payload 2
-
-var cargo = async.cargo(function (tasks, callback) {
- for(var i=0; i
-### auto(tasks, [callback])
-
-Determines the best order for running functions based on their requirements.
-Each function can optionally depend on other functions being completed first,
-and each function is run as soon as its requirements are satisfied. If any of
-the functions pass an error to their callback, that function will not complete
-(so any other functions depending on it will not run) and the main callback
-will be called immediately with the error. Functions also receive an object
-containing the results of functions which have completed so far.
-
-Note, all functions are called with a results object as a second argument,
-so it is unsafe to pass functions in the tasks object which cannot handle the
-extra argument. For example, this snippet of code:
-
-```js
-async.auto({
- readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
-}, callback);
-```
-
-will have the effect of calling readFile with the results object as the last
-argument, which will fail:
-
-```js
-fs.readFile('data.txt', 'utf-8', cb, {});
-```
-
-Instead, wrap the call to readFile in a function which does not forward the
-results object:
-
-```js
-async.auto({
- readData: function(cb, results){
- fs.readFile('data.txt', 'utf-8', cb);
- }
-}, callback);
-```
-
-__Arguments__
-
-* tasks - An object literal containing named functions or an array of
- requirements, with the function itself the last item in the array. The key
- used for each function or array is used when specifying requirements. The
- function receives two arguments: (1) a callback(err, result) which must be
- called when finished, passing an error (which can be null) and the result of
- the function's execution, and (2) a results object, containing the results of
- the previously executed functions.
-* callback(err, results) - An optional callback which is called when all the
- tasks have been completed. The callback will receive an error as an argument
- if any tasks pass an error to their callback. Results will always be passed
- but if an error occurred, no other tasks will be performed, and the results
- object will only contain partial results.
-
-
-__Example__
-
-```js
-async.auto({
- get_data: function(callback){
- // async code to get some data
- },
- make_folder: function(callback){
- // async code to create a directory to store a file in
- // this is run at the same time as getting the data
- },
- write_file: ['get_data', 'make_folder', function(callback){
- // once there is some data and the directory exists,
- // write the data to a file in the directory
- callback(null, filename);
- }],
- email_link: ['write_file', function(callback, results){
- // once the file is written let's email a link to it...
- // results.write_file contains the filename returned by write_file.
- }]
-});
-```
-
-This is a fairly trivial example, but to do this using the basic parallel and
-series functions would look like this:
-
-```js
-async.parallel([
- function(callback){
- // async code to get some data
- },
- function(callback){
- // async code to create a directory to store a file in
- // this is run at the same time as getting the data
- }
-],
-function(err, results){
- async.series([
- function(callback){
- // once there is some data and the directory exists,
- // write the data to a file in the directory
- },
- function(callback){
- // once the file is written let's email a link to it...
- }
- ]);
-});
-```
-
-For a complicated series of async tasks using the auto function makes adding
-new tasks much easier and makes the code more readable.
-
-
----------------------------------------
-
-
-### iterator(tasks)
-
-Creates an iterator function which calls the next function in the array,
-returning a continuation to call the next one after that. It's also possible to
-'peek' the next iterator by doing iterator.next().
-
-This function is used internally by the async module but can be useful when
-you want to manually control the flow of functions in series.
-
-__Arguments__
-
-* tasks - An array of functions to run.
-
-__Example__
-
-```js
-var iterator = async.iterator([
- function(){ sys.p('one'); },
- function(){ sys.p('two'); },
- function(){ sys.p('three'); }
-]);
-
-node> var iterator2 = iterator();
-'one'
-node> var iterator3 = iterator2();
-'two'
-node> iterator3();
-'three'
-node> var nextfn = iterator2.next();
-node> nextfn();
-'three'
-```
-
----------------------------------------
-
-
-### apply(function, arguments..)
-
-Creates a continuation function with some arguments already applied, a useful
-shorthand when combined with other control flow functions. Any arguments
-passed to the returned function are added to the arguments originally passed
-to apply.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to automatically apply when the
- continuation is called.
-
-__Example__
-
-```js
-// using apply
-
-async.parallel([
- async.apply(fs.writeFile, 'testfile1', 'test1'),
- async.apply(fs.writeFile, 'testfile2', 'test2'),
-]);
-
-
-// the same process without using apply
-
-async.parallel([
- function(callback){
- fs.writeFile('testfile1', 'test1', callback);
- },
- function(callback){
- fs.writeFile('testfile2', 'test2', callback);
- }
-]);
-```
-
-It's possible to pass any number of additional arguments when calling the
-continuation:
-
-```js
-node> var fn = async.apply(sys.puts, 'one');
-node> fn('two', 'three');
-one
-two
-three
-```
-
----------------------------------------
-
-
-### nextTick(callback)
-
-Calls the callback on a later loop around the event loop. In node.js this just
-calls process.nextTick, in the browser it falls back to setImmediate(callback)
-if available, otherwise setTimeout(callback, 0), which means other higher priority
-events may precede the execution of the callback.
-
-This is used internally for browser-compatibility purposes.
-
-__Arguments__
-
-* callback - The function to call on a later loop around the event loop.
-
-__Example__
-
-```js
-var call_order = [];
-async.nextTick(function(){
- call_order.push('two');
- // call_order now equals ['one','two']
-});
-call_order.push('one')
-```
-
-
-### times(n, callback)
-
-Calls the callback n times and accumulates results in the same manner
-you would use with async.map.
-
-__Arguments__
-
-* n - The number of times to run the function.
-* callback - The function to call n times.
-
-__Example__
-
-```js
-// Pretend this is some complicated async factory
-var createUser = function(id, callback) {
- callback(null, {
- id: 'user' + id
- })
-}
-// generate 5 users
-async.times(5, function(n, next){
- createUser(n, function(err, user) {
- next(err, user)
- })
-}, function(err, users) {
- // we should now have 5 users
-});
-```
-
-
-### timesSeries(n, callback)
-
-The same as times only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
-
-## Utils
-
-
-### memoize(fn, [hasher])
-
-Caches the results of an async function. When creating a hash to store function
-results against, the callback is omitted from the hash and an optional hash
-function can be used.
-
-The cache of results is exposed as the `memo` property of the function returned
-by `memoize`.
-
-__Arguments__
-
-* fn - the function you to proxy and cache results from.
-* hasher - an optional function for generating a custom hash for storing
- results, it has all the arguments applied to it apart from the callback, and
- must be synchronous.
-
-__Example__
-
-```js
-var slow_fn = function (name, callback) {
- // do something
- callback(null, result);
-};
-var fn = async.memoize(slow_fn);
-
-// fn can now be used as if it were slow_fn
-fn('some name', function () {
- // callback
-});
-```
-
-
-### unmemoize(fn)
-
-Undoes a memoized function, reverting it to the original, unmemoized
-form. Comes handy in tests.
-
-__Arguments__
-
-* fn - the memoized function
-
-
-### log(function, arguments)
-
-Logs the result of an async function to the console. Only works in node.js or
-in browsers that support console.log and console.error (such as FF and Chrome).
-If multiple arguments are returned from the async function, console.log is
-called on each argument in order.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to apply to the function.
-
-__Example__
-
-```js
-var hello = function(name, callback){
- setTimeout(function(){
- callback(null, 'hello ' + name);
- }, 1000);
-};
-```
-```js
-node> async.log(hello, 'world');
-'hello world'
-```
-
----------------------------------------
-
-
-### dir(function, arguments)
-
-Logs the result of an async function to the console using console.dir to
-display the properties of the resulting object. Only works in node.js or
-in browsers that support console.dir and console.error (such as FF and Chrome).
-If multiple arguments are returned from the async function, console.dir is
-called on each argument in order.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to apply to the function.
-
-__Example__
-
-```js
-var hello = function(name, callback){
- setTimeout(function(){
- callback(null, {hello: name});
- }, 1000);
-};
-```
-```js
-node> async.dir(hello, 'world');
-{hello: 'world'}
-```
-
----------------------------------------
-
-
-### noConflict()
-
-Changes the value of async back to its original value, returning a reference to the
-async object.
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/winston/node_modules/async/component.json b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/winston/node_modules/async/component.json
deleted file mode 100644
index bbb011548..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/winston/node_modules/async/component.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "async",
- "repo": "caolan/async",
- "description": "Higher-order functions and common patterns for asynchronous code",
- "version": "0.1.23",
- "keywords": [],
- "dependencies": {},
- "development": {},
- "main": "lib/async.js",
- "scripts": [ "lib/async.js" ]
-}
diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/winston/node_modules/async/lib/async.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/winston/node_modules/async/lib/async.js
deleted file mode 100755
index 1eebb153f..000000000
--- a/computer-science/01-introduction-to-cs-and-programming-mit/src/node_modules/prompt/node_modules/winston/node_modules/async/lib/async.js
+++ /dev/null
@@ -1,958 +0,0 @@
-/*global setImmediate: false, setTimeout: false, console: false */
-(function () {
-
- var async = {};
-
- // global on the server, window in the browser
- var root, previous_async;
-
- root = this;
- if (root != null) {
- previous_async = root.async;
- }
-
- async.noConflict = function () {
- root.async = previous_async;
- return async;
- };
-
- function only_once(fn) {
- var called = false;
- return function() {
- if (called) throw new Error("Callback was already called.");
- called = true;
- fn.apply(root, arguments);
- }
- }
-
- //// cross-browser compatiblity functions ////
-
- var _each = function (arr, iterator) {
- if (arr.forEach) {
- return arr.forEach(iterator);
- }
- for (var i = 0; i < arr.length; i += 1) {
- iterator(arr[i], i, arr);
- }
- };
-
- var _map = function (arr, iterator) {
- if (arr.map) {
- return arr.map(iterator);
- }
- var results = [];
- _each(arr, function (x, i, a) {
- results.push(iterator(x, i, a));
- });
- return results;
- };
-
- var _reduce = function (arr, iterator, memo) {
- if (arr.reduce) {
- return arr.reduce(iterator, memo);
- }
- _each(arr, function (x, i, a) {
- memo = iterator(memo, x, i, a);
- });
- return memo;
- };
-
- var _keys = function (obj) {
- if (Object.keys) {
- return Object.keys(obj);
- }
- var keys = [];
- for (var k in obj) {
- if (obj.hasOwnProperty(k)) {
- keys.push(k);
- }
- }
- return keys;
- };
-
- //// exported async module functions ////
-
- //// nextTick implementation with browser-compatible fallback ////
- if (typeof process === 'undefined' || !(process.nextTick)) {
- if (typeof setImmediate === 'function') {
- async.nextTick = function (fn) {
- // not a direct alias for IE10 compatibility
- setImmediate(fn);
- };
- async.setImmediate = async.nextTick;
- }
- else {
- async.nextTick = function (fn) {
- setTimeout(fn, 0);
- };
- async.setImmediate = async.nextTick;
- }
- }
- else {
- async.nextTick = process.nextTick;
- if (typeof setImmediate !== 'undefined') {
- async.setImmediate = function (fn) {
- // not a direct alias for IE10 compatibility
- setImmediate(fn);
- };
- }
- else {
- async.setImmediate = async.nextTick;
- }
- }
-
- async.each = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- _each(arr, function (x) {
- iterator(x, only_once(function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback(null);
- }
- }
- }));
- });
- };
- async.forEach = async.each;
-
- async.eachSeries = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- var iterate = function () {
- iterator(arr[completed], function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback(null);
- }
- else {
- iterate();
- }
- }
- });
- };
- iterate();
- };
- async.forEachSeries = async.eachSeries;
-
- async.eachLimit = function (arr, limit, iterator, callback) {
- var fn = _eachLimit(limit);
- fn.apply(null, [arr, iterator, callback]);
- };
- async.forEachLimit = async.eachLimit;
-
- var _eachLimit = function (limit) {
-
- return function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length || limit <= 0) {
- return callback();
- }
- var completed = 0;
- var started = 0;
- var running = 0;
-
- (function replenish () {
- if (completed >= arr.length) {
- return callback();
- }
-
- while (running < limit && started < arr.length) {
- started += 1;
- running += 1;
- iterator(arr[started - 1], function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- running -= 1;
- if (completed >= arr.length) {
- callback();
- }
- else {
- replenish();
- }
- }
- });
- }
- })();
- };
- };
-
-
- var doParallel = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.each].concat(args));
- };
- };
- var doParallelLimit = function(limit, fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [_eachLimit(limit)].concat(args));
- };
- };
- var doSeries = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.eachSeries].concat(args));
- };
- };
-
-
- var _asyncMap = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (err, v) {
- results[x.index] = v;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- };
- async.map = doParallel(_asyncMap);
- async.mapSeries = doSeries(_asyncMap);
- async.mapLimit = function (arr, limit, iterator, callback) {
- return _mapLimit(limit)(arr, iterator, callback);
- };
-
- var _mapLimit = function(limit) {
- return doParallelLimit(limit, _asyncMap);
- };
-
- // reduce only has a series version, as doing reduce in parallel won't
- // work in many situations.
- async.reduce = function (arr, memo, iterator, callback) {
- async.eachSeries(arr, function (x, callback) {
- iterator(memo, x, function (err, v) {
- memo = v;
- callback(err);
- });
- }, function (err) {
- callback(err, memo);
- });
- };
- // inject alias
- async.inject = async.reduce;
- // foldl alias
- async.foldl = async.reduce;
-
- async.reduceRight = function (arr, memo, iterator, callback) {
- var reversed = _map(arr, function (x) {
- return x;
- }).reverse();
- async.reduce(reversed, memo, iterator, callback);
- };
- // foldr alias
- async.foldr = async.reduceRight;
-
- var _filter = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (v) {
- if (v) {
- results.push(x);
- }
- callback();
- });
- }, function (err) {
- callback(_map(results.sort(function (a, b) {
- return a.index - b.index;
- }), function (x) {
- return x.value;
- }));
- });
- };
- async.filter = doParallel(_filter);
- async.filterSeries = doSeries(_filter);
- // select alias
- async.select = async.filter;
- async.selectSeries = async.filterSeries;
-
- var _reject = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (v) {
- if (!v) {
- results.push(x);
- }
- callback();
- });
- }, function (err) {
- callback(_map(results.sort(function (a, b) {
- return a.index - b.index;
- }), function (x) {
- return x.value;
- }));
- });
- };
- async.reject = doParallel(_reject);
- async.rejectSeries = doSeries(_reject);
-
- var _detect = function (eachfn, arr, iterator, main_callback) {
- eachfn(arr, function (x, callback) {
- iterator(x, function (result) {
- if (result) {
- main_callback(x);
- main_callback = function () {};
- }
- else {
- callback();
- }
- });
- }, function (err) {
- main_callback();
- });
- };
- async.detect = doParallel(_detect);
- async.detectSeries = doSeries(_detect);
-
- async.some = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
- iterator(x, function (v) {
- if (v) {
- main_callback(true);
- main_callback = function () {};
- }
- callback();
- });
- }, function (err) {
- main_callback(false);
- });
- };
- // any alias
- async.any = async.some;
-
- async.every = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
- iterator(x, function (v) {
- if (!v) {
- main_callback(false);
- main_callback = function () {};
- }
- callback();
- });
- }, function (err) {
- main_callback(true);
- });
- };
- // all alias
- async.all = async.every;
-
- async.sortBy = function (arr, iterator, callback) {
- async.map(arr, function (x, callback) {
- iterator(x, function (err, criteria) {
- if (err) {
- callback(err);
- }
- else {
- callback(null, {value: x, criteria: criteria});
- }
- });
- }, function (err, results) {
- if (err) {
- return callback(err);
- }
- else {
- var fn = function (left, right) {
- var a = left.criteria, b = right.criteria;
- return a < b ? -1 : a > b ? 1 : 0;
- };
- callback(null, _map(results.sort(fn), function (x) {
- return x.value;
- }));
- }
- });
- };
-
- async.auto = function (tasks, callback) {
- callback = callback || function () {};
- var keys = _keys(tasks);
- if (!keys.length) {
- return callback(null);
- }
-
- var results = {};
-
- var listeners = [];
- var addListener = function (fn) {
- listeners.unshift(fn);
- };
- var removeListener = function (fn) {
- for (var i = 0; i < listeners.length; i += 1) {
- if (listeners[i] === fn) {
- listeners.splice(i, 1);
- return;
- }
- }
- };
- var taskComplete = function () {
- _each(listeners.slice(0), function (fn) {
- fn();
- });
- };
-
- addListener(function () {
- if (_keys(results).length === keys.length) {
- callback(null, results);
- callback = function () {};
- }
- });
-
- _each(keys, function (k) {
- var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
- var taskCallback = function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- if (err) {
- var safeResults = {};
- _each(_keys(results), function(rkey) {
- safeResults[rkey] = results[rkey];
- });
- safeResults[k] = args;
- callback(err, safeResults);
- // stop subsequent errors hitting callback multiple times
- callback = function () {};
- }
- else {
- results[k] = args;
- async.setImmediate(taskComplete);
- }
- };
- var requires = task.slice(0, Math.abs(task.length - 1)) || [];
- var ready = function () {
- return _reduce(requires, function (a, x) {
- return (a && results.hasOwnProperty(x));
- }, true) && !results.hasOwnProperty(k);
- };
- if (ready()) {
- task[task.length - 1](taskCallback, results);
- }
- else {
- var listener = function () {
- if (ready()) {
- removeListener(listener);
- task[task.length - 1](taskCallback, results);
- }
- };
- addListener(listener);
- }
- });
- };
-
- async.waterfall = function (tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor !== Array) {
- var err = new Error('First argument to waterfall must be an array of functions');
- return callback(err);
- }
- if (!tasks.length) {
- return callback();
- }
- var wrapIterator = function (iterator) {
- return function (err) {
- if (err) {
- callback.apply(null, arguments);
- callback = function () {};
- }
- else {
- var args = Array.prototype.slice.call(arguments, 1);
- var next = iterator.next();
- if (next) {
- args.push(wrapIterator(next));
- }
- else {
- args.push(callback);
- }
- async.setImmediate(function () {
- iterator.apply(null, args);
- });
- }
- };
- };
- wrapIterator(async.iterator(tasks))();
- };
-
- var _parallel = function(eachfn, tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor === Array) {
- eachfn.map(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
- }
- }, callback);
- }
- else {
- var results = {};
- eachfn.each(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
-
- async.parallel = function (tasks, callback) {
- _parallel({ map: async.map, each: async.each }, tasks, callback);
- };
-
- async.parallelLimit = function(tasks, limit, callback) {
- _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
- };
-
- async.series = function (tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor === Array) {
- async.mapSeries(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
- }
- }, callback);
- }
- else {
- var results = {};
- async.eachSeries(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
-
- async.iterator = function (tasks) {
- var makeCallback = function (index) {
- var fn = function () {
- if (tasks.length) {
- tasks[index].apply(null, arguments);
- }
- return fn.next();
- };
- fn.next = function () {
- return (index < tasks.length - 1) ? makeCallback(index + 1): null;
- };
- return fn;
- };
- return makeCallback(0);
- };
-
- async.apply = function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
- return function () {
- return fn.apply(
- null, args.concat(Array.prototype.slice.call(arguments))
- );
- };
- };
-
- var _concat = function (eachfn, arr, fn, callback) {
- var r = [];
- eachfn(arr, function (x, cb) {
- fn(x, function (err, y) {
- r = r.concat(y || []);
- cb(err);
- });
- }, function (err) {
- callback(err, r);
- });
- };
- async.concat = doParallel(_concat);
- async.concatSeries = doSeries(_concat);
-
- async.whilst = function (test, iterator, callback) {
- if (test()) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- async.whilst(test, iterator, callback);
- });
- }
- else {
- callback();
- }
- };
-
- async.doWhilst = function (iterator, test, callback) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- if (test()) {
- async.doWhilst(iterator, test, callback);
- }
- else {
- callback();
- }
- });
- };
-
- async.until = function (test, iterator, callback) {
- if (!test()) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- async.until(test, iterator, callback);
- });
- }
- else {
- callback();
- }
- };
-
- async.doUntil = function (iterator, test, callback) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- if (!test()) {
- async.doUntil(iterator, test, callback);
- }
- else {
- callback();
- }
- });
- };
-
- async.queue = function (worker, concurrency) {
- if (concurrency === undefined) {
- concurrency = 1;
- }
- function _insert(q, data, pos, callback) {
- if(data.constructor !== Array) {
- data = [data];
- }
- _each(data, function(task) {
- var item = {
- data: task,
- callback: typeof callback === 'function' ? callback : null
- };
-
- if (pos) {
- q.tasks.unshift(item);
- } else {
- q.tasks.push(item);
- }
-
- if (q.saturated && q.tasks.length === concurrency) {
- q.saturated();
- }
- async.setImmediate(q.process);
- });
- }
-
- var workers = 0;
- var q = {
- tasks: [],
- concurrency: concurrency,
- saturated: null,
- empty: null,
- drain: null,
- push: function (data, callback) {
- _insert(q, data, false, callback);
- },
- unshift: function (data, callback) {
- _insert(q, data, true, callback);
- },
- process: function () {
- if (workers < q.concurrency && q.tasks.length) {
- var task = q.tasks.shift();
- if (q.empty && q.tasks.length === 0) {
- q.empty();
- }
- workers += 1;
- var next = function () {
- workers -= 1;
- if (task.callback) {
- task.callback.apply(task, arguments);
- }
- if (q.drain && q.tasks.length + workers === 0) {
- q.drain();
- }
- q.process();
- };
- var cb = only_once(next);
- worker(task.data, cb);
- }
- },
- length: function () {
- return q.tasks.length;
- },
- running: function () {
- return workers;
- }
- };
- return q;
- };
-
- async.cargo = function (worker, payload) {
- var working = false,
- tasks = [];
-
- var cargo = {
- tasks: tasks,
- payload: payload,
- saturated: null,
- empty: null,
- drain: null,
- push: function (data, callback) {
- if(data.constructor !== Array) {
- data = [data];
- }
- _each(data, function(task) {
- tasks.push({
- data: task,
- callback: typeof callback === 'function' ? callback : null
- });
- if (cargo.saturated && tasks.length === payload) {
- cargo.saturated();
- }
- });
- async.setImmediate(cargo.process);
- },
- process: function process() {
- if (working) return;
- if (tasks.length === 0) {
- if(cargo.drain) cargo.drain();
- return;
- }
-
- var ts = typeof payload === 'number'
- ? tasks.splice(0, payload)
- : tasks.splice(0);
-
- var ds = _map(ts, function (task) {
- return task.data;
- });
-
- if(cargo.empty) cargo.empty();
- working = true;
- worker(ds, function () {
- working = false;
-
- var args = arguments;
- _each(ts, function (data) {
- if (data.callback) {
- data.callback.apply(null, args);
- }
- });
-
- process();
- });
- },
- length: function () {
- return tasks.length;
- },
- running: function () {
- return working;
- }
- };
- return cargo;
- };
-
- var _console_fn = function (name) {
- return function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
- fn.apply(null, args.concat([function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (typeof console !== 'undefined') {
- if (err) {
- if (console.error) {
- console.error(err);
- }
- }
- else if (console[name]) {
- _each(args, function (x) {
- console[name](x);
- });
- }
- }
- }]));
- };
- };
- async.log = _console_fn('log');
- async.dir = _console_fn('dir');
- /*async.info = _console_fn('info');
- async.warn = _console_fn('warn');
- async.error = _console_fn('error');*/
-
- async.memoize = function (fn, hasher) {
- var memo = {};
- var queues = {};
- hasher = hasher || function (x) {
- return x;
- };
- var memoized = function () {
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- var key = hasher.apply(null, args);
- if (key in memo) {
- callback.apply(null, memo[key]);
- }
- else if (key in queues) {
- queues[key].push(callback);
- }
- else {
- queues[key] = [callback];
- fn.apply(null, args.concat([function () {
- memo[key] = arguments;
- var q = queues[key];
- delete queues[key];
- for (var i = 0, l = q.length; i < l; i++) {
- q[i].apply(null, arguments);
- }
- }]));
- }
- };
- memoized.memo = memo;
- memoized.unmemoized = fn;
- return memoized;
- };
-
- async.unmemoize = function (fn) {
- return function () {
- return (fn.unmemoized || fn).apply(null, arguments);
- };
- };
-
- async.times = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.map(counter, iterator, callback);
- };
-
- async.timesSeries = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.mapSeries(counter, iterator, callback);
- };
-
- async.compose = function (/* functions... */) {
- var fns = Array.prototype.reverse.call(arguments);
- return function () {
- var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- async.reduce(fns, args, function (newargs, fn, cb) {
- fn.apply(that, newargs.concat([function () {
- var err = arguments[0];
- var nextargs = Array.prototype.slice.call(arguments, 1);
- cb(err, nextargs);
- }]))
- },
- function (err, results) {
- callback.apply(that, [err].concat(results));
- });
- };
- };
-
- var _applyEach = function (eachfn, fns /*args...*/) {
- var go = function () {
- var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- return eachfn(fns, function (fn, cb) {
- fn.apply(that, args.concat([cb]));
- },
- callback);
- };
- if (arguments.length > 2) {
- var args = Array.prototype.slice.call(arguments, 2);
- return go.apply(this, args);
- }
- else {
- return go;
- }
- };
- async.applyEach = doParallel(_applyEach);
- async.applyEachSeries = doSeries(_applyEach);
-
- async.forever = function (fn, callback) {
- function next(err) {
- if (err) {
- if (callback) {
- return callback(err);
- }
- throw err;
- }
- fn(next);
- }
- next();
- };
-
- // AMD / RequireJS
- if (typeof define !== 'undefined' && define.amd) {
- define([], function () {
- return async;
- });
- }
- // Node.js
- else if (typeof module !== 'undefined' && module.exports) {
- module.exports = async;
- }
- // included directly via
-
-
-
-
-