├── .gitignore ├── index.js ├── package.json ├── readme.md ├── simple.en.md ├── technical.en.md └── test └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | var path = require('path') 3 | 4 | exports.getVariantPath = function (type, language, format) { 5 | if (!format) { 6 | format = 'md' 7 | } 8 | if (format !== 'md') { 9 | throw new TypeError('No implementation for other formats yet') 10 | } 11 | if (language !== 'en') { 12 | throw new TypeError('Languages are not implemented yet') 13 | } 14 | return path.join(__dirname, type + '.' + language + '.md') 15 | } 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "what-is-node", 3 | "version": "1.0.0", 4 | "description": "Variants explaining: What is node?", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "standard && npm run remark && npm run unit", 8 | "remark": "remark -u remark-lint *.md", 9 | "unit": "tap test/**/*.js" 10 | }, 11 | "keywords": [ 12 | "introduction", 13 | "about", 14 | "short-but-good" 15 | ], 16 | "author": "Martin Heidegger ", 17 | "license": "ISC", 18 | "devDependencies": { 19 | "remark": "^4.2.2", 20 | "standard": "^7.0.1" 21 | }, 22 | "dependencies": { 23 | "remark-lint": "^3.2.1", 24 | "tap": "^5.7.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # What is NodeJS 2 | 3 | Do you know what NodeJS is? Many people don't! They ask for it and we 4 | thought it might be a good idea to have a set of answers ready in case 5 | we are asked. 6 | 7 | ## Variants 8 | 9 | | Language | Type | Link | 10 | |----------|-----------|---------------------------| 11 | | english | simple | [link](./simple.en.md) | 12 | | english | technical | [link](./technical.en.md) | 13 | 14 | ## Add your variant 15 | 16 | If you think you have a variant explanation (either translated or 17 | differently explained) available or if you think that one explanation 18 | isn't good. Please 19 | [let us know](https://github.com/nodeschool/what-is-node/issues) or 20 | [submit a PR](https://github.com/nodeschool/what-is-node/pulls). 21 | -------------------------------------------------------------------------------- /simple.en.md: -------------------------------------------------------------------------------- 1 | Node.js is a [program](https://simple.wikipedia.org/wiki/Computer_program) that 2 | you install on your computer. With Node.js you can use the very popular 3 | [programming](https://simple.wikipedia.org/wiki/Computer_programming) language 4 | [JavaScript](https://simple.wikipedia.org/wiki/JavaScript) to write 5 | [software](https://simple.wikipedia.org/wiki/Software). 6 | 7 | JavaScript is usually used in a 8 | [browser](https://simple.wikipedia.org/wiki/Web_browser) like 9 | [Internet Explorer](https://simple.wikipedia.org/wiki/Internet_Explorer) or 10 | [Safari](https://simple.wikipedia.org/wiki/Safari_(web_browser)) but with 11 | Node.js it is possible to do a lot more. 12 | 13 | Combined with other tools, Node.js allows you to write 14 | [Desktop](https://simple.wikipedia.org/wiki/Desktop_environment) applications 15 | like [Word](https://simple.wikipedia.org/wiki/Microsoft_Word) or 16 | [iTunes](https://simple.wikipedia.org/wiki/ITunes), Server applications 17 | like [Apache](https://simple.wikipedia.org/wiki/Apache_HTTP_Server), 18 | Network applications like [Curl](https://curl.haxx.se/) or even mobile 19 | applications for the iPhone or Android. 20 | -------------------------------------------------------------------------------- /technical.en.md: -------------------------------------------------------------------------------- 1 | Node.js® is a JavaScript runtime built on 2 | [Chrome's V8 JavaScript engine](https://developers.google.com/v8/). Node.js 3 | uses an event-driven, non-blocking I/O model that makes it lightweight and 4 | efficient. Node.js' package ecosystem, npm, is the largest ecosystem of 5 | open source libraries in the world. 6 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var win = require('..') 3 | var path = require('path') 4 | 5 | test('getting the path of a simple variant', function (t) { 6 | t.equal(win.getVariantPath('simple', 'en'), path.join(path.dirname(__dirname), 'simple.en.md')) 7 | t.end() 8 | }) 9 | test('make sure that lang other than `en` is not supported', function (t) { 10 | t.throws(function () { 11 | win.getVariantPath('simple', 'fr') 12 | }, TypeError) 13 | t.end() 14 | }) 15 | test('make sure that lang other than `md` is not supported', function (t) { 16 | t.throws(function () { 17 | win.getVariantPath('simple', 'fr', 'txt') 18 | }, TypeError) 19 | t.end() 20 | }) 21 | --------------------------------------------------------------------------------