Description::
The-Node.js-language (ljn) is a-javascript-language that is-understood by the-Node.js-runtime.
[HmnSgm.2016-07-01]
===
Node.js® is a javascript runtime built on Chrome's V8 javascript engine.
Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
[https://nodejs.org/en/]
===
Node.js is a server-side javascript environment that uses an asynchronous event-driven model.
This allows Node.js to get excellent performance based on the architectures of many Internet applications.
[https://github.com/joyent/node/wiki]
===
Ignore the name: Node.js isn't a javascript library.
Instead, Node.js is a javascript interpreter (powered by V8, the engine used by Google's Chrome browser) that interfaces with the underlying operating system.
That way, javascript run by Node.js can read and write files, spawn processes, and—most enticingly—send and receive HTTP requests.
[http://media.pragprog.com/titles/tbcoffee/server.pdf]
===
An important thing to realize is that Node is not a webserver.
By itself it doesn't do anything.
It doesn't work like Apache.
There is no config file where you point it to you HTML files.
If you want it to be a HTTP server, you have to write an HTTP server (with the help of its built-in libraries).
Node.js is just another way to execute code on your computer.
It is simply a javascript runtime.
[http://blog.modulus.io/absolute-beginners-guide-to-nodejs]
===
Node.js is a platform built on Chrome's javascript runtime for easily building fast, scalable network applications.
Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
[http://nodejs.org/]
===
Node is a javascript environment running in Google's V8 javascript engine.
[http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/]
===
Joyent is the corporate steward of Node.js, the world's best runtime for today's data-intensive, real-time applications.
Joyent offers exclusive debugging and performance analysis tools for Node.js applications.
[https://www.joyent.com/technology/nodejs]
===
Node.js is a native javascript server application running right up against the OS.
Node.js builds directly on Chrome V8 and uses event-driven, asynchronous javascript to create a very distinctive development environment.
Node.js has very few dependencies, runs very fast, and has a very active community.
Most of all, its fun!
I ported the Google Wave Gadget API implementation from Apache Wookie over to Node.js in a couple of days (you can download it here).
Node also seems to use very little memory regardless of demand - this is due to it using a threadless, event driven server model rather than a more traditional thread pool approach.
On the downside, there is some skepticism of the hype around the speed of Node.js.
Also, while being very lightweight has its advantages, being so close to the OS makes it harder to manage and track server performance without a lot of Linux Jujitsu: there are, as yet, no simple graphical management tools or utilities for handling deployed applications, for example.
However, if you need a platform to prototype demanding real-time applications such as multiplayer games then Node.js is well worth looking at.
[http://zope.cetis.ac.uk/members/scott/blogview?entry=20110124133546]
===
Node.js is an event-driven I/O framework for the V8 javascript engine on Unix-like platforms.
It is intended for writing scalable network programs such as web servers[1].
It was created by Ryan Dahl in 2009, and its growth is sponsored by Joyent, which employs Dahl[2].
Node.js is similar in purpose to Twisted for Python, Perl Object Environment for Perl, and EventMachine for Ruby.
Unlike most javascript, it is not executed in a web browser, but it is rather related to server-side javascript.
Node.js implements some CommonJS specifications[3].
Node.js includes a REPL environment for interactive testing.
[http://en.wikipedia.org/wiki/Node.js]
Name::
* cpt.Language.javascript.Node,
* cpt.LanguageJavascriptNode,
* cpt.LcpNodejs,
* cpt.Ljn-(LanguageJavascriptNode), {2016.05.27}
* cpt.Ljs-nd, {2014.02.16}
* cpt.Node-(Ljn),
* cpt.Node.js-language-(Ljn),
* cpt.Node-javascript-(Ljn),
* cpt.Node-js-(Ljn),
* cpt.NodeJS-(Ljn),
* cpt.Server-side-javascript,
===
* Lnj, {2016.05.10}
* Ndjs,
Description::
NodeJs is a perfect candidate for real time communication over internet.
[https://www.quora.com/What-are-the-pros-and-cons-of-Node-js-versus-Apache-web-server]
===
Node.js had an extraordinary year so far: npm already hit 4 million users and processes a billion downloads a week, while major enterprises adopt the language as the main production framework day by day.
[https://blog.risingstack.com/node-js-examples-how-enterprises-use-node-in-2016/]
Generic::
* Ljs-archetype,
AddressWpg::
* https://blog.risingstack.com/node-js-examples-how-enterprises-use-node-in-2016/
Generic::
* Ljs-algorithm,
Name::
* cpt.Ljn-algorithm,
* cpt.Ljn-algo,
* cpt.Ljn-algo, {2014.03.10}
Generic::
* Ljs-code,
Name::
* cpt.Ljn-code,
* cpt.Ljn-code,
Part::
* dir-of-code,
* file-of-code,
Description::
So far we've only been using a single file, which isn't very maintainable.
In most applications your code will be split into several files.
There's no standard or enforced organization to what files go where.
This isn't Rails.
There's no concept of views go here and controllers go there.
You can do whatever you want.
[http://blog.modulus.io/absolute-beginners-guide-to-nodejs]
AddressWpg::
* https://www.airpair.com/node.js/posts/top-10-mistakes-node-developers-make,
Generic::
* Ljs-unit,
Generic::
* Ljs-word,
Generic::
* Ljs-semantic-unit,
Name::
* cpt.Ljn-semantic-unit,
* cpt.Ljn-sut-(Node-js-semantic-unit),
Specific::
See Ljb-specific-semantic-unit.
01) a - Array,
02) b - Boolean,
03) f - Function,
04) l - nuLl,
05) m - Module,
06) n - Number,
07) o - Object,
08) r - Regexp,
09) s - String,
10) u - Undefined,
11) v - name-Value-pair,
12) x - miXed,
Description::
Because javascript is event-oriented rather than thread-oriented, events only run when all other execution has stopped.
Imagine how frustrating it would be if every time your application made a request (say, to the file system or to an HTTP server), it froze up completely until the request was completed!
For that reason, nearly every function in the Node.js API uses a callback:
you make your request, Node.js quickly passes it along, and your application continues as if nothing happened.
When your request is completed (or goes awry), the function you passed to Node.js gets called.
[http://media.pragprog.com/titles/tbcoffee/server.pdf]
Name::
* cpt.Ljn-function,
* cpt.Ljnf-(Nodejs-function),
Generic::
* Ljs-function.
Description::
Node API is not all asynchronous.
Some parts of it are synchronous but they are very well marked: they always terminate in "Sync" - lik fs.readFileSync...
One function that is synchronous and does not end in Sync is 'require' which should only be used when initializing an app or module.
[http://nodetuts.com/pdf/handson-nodejs-sample.pdf]
Generic::
* Ljs-object,
Name::
* cpt.Ljn-object,
* cpt.Ljn-o-(Nodejs-object),
* cpt.Ljno-(Nodejs-object),
Generic::
* Ljs-name-value-pair,
Name::
* cpt.Ljn-name-value-pair,
* cpt.Ljn-nvp,
* cpt.Ljn-nvp,
* cpt.Ljn-v,
Description::
Module is a-semantic-unit which
- can-be PART OF other modules and
- can-has AS PART other modules
with the-require()-function.
Like 'the-prototype-inheritance' mechanism which manages the GENERIC-SPECIFIC relations of the-semantic-units of an-API, modules is the-mechanism needed to manage the WHOLE-PART relations of the-semantic-units.
In contrast to objects, modules HAVE scope, ie its members see each other.
Name::
* cpt.Ljn-module-semantic-unit,
* cpt.Ljn-module-sut,
* cpt.Ljn-m-(Node-js-module), {2016.06.27}
* cpt.Ljn-mdl, {2016.06.14}
* cpt.Ljn-module,
* cpt.Node-js-module,
===
NOTATION:
I name the-modules as 'm?Name' where ? = a,b,f,n,o,r,s denotes the-type of the-semantic-unit-they-export (public-member).
[HmnSgm.2016-12-01]
I name the-modules as 'mName' if they export objects and 'm?Name' where ? = a,b,f,n,r,s if they export other semantic-units.
[HmnSgm.2016-07-25]
Description::
Do-NOT-confuse the-module-semantic-unit (this-concept), with the-module-object, which is a-member of any module-semantic-unit.
[HmnSgm.2016-07-23]
===
Module is an OBJECT importing/exporting from a file or directory code-structure.
It can have explicitly defined properties with 'exports.property' code
or it can be a single exported function/object with the 'module.exports' code.
[HmnSgm.2014-04-22]
===
Modules make it possible to include other Javascript files into your applications.
... Modules are crucial to building applications in Node, as they allow you to include external libraries, such as database access libraries - and they help in organizing your code into separate parts with limited responsibilities.
You should try to identify reusable parts in your own code and turn them into separate modules to reduce the amount of code per file and to make it easier to read and maintain your code.
[http://book.mixu.net/node/single.html]
===
Node has a simple module loading system.
In Node, files and modules are in one-to-one correspondence.
[https://nodejs.org/docs/v6.3.1/api/modules.html#modules_modules]
===
Node.js uses a module architecture to simplify the creation of complex applications.
Modules are akin to libraries in C, or units in Pascal.
Each module contains a set of functions related to the “subject” of the module.
For example, the http module contains functions specific to HTTP.
Node.js provides a few core modules out of the box to help you access files on the file system, create HTTP and TCP/UDP servers, and perform other useful functions.
Including a module is easy; simply call the require() function, like this:
> var http = require('http');
The require() function returns the reference to the specified module.
In the case of this code, a reference to the http module is stored in the http variable.
[http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/]
Description::
Caching
Modules are cached after the first time they are loaded.
This means (among other things) that every call to require('foo') will get exactly the same object returned, if it would resolve to the same file.
Multiple calls to require('foo') may not cause the module code to be executed multiple times.
This is an important feature.
With it, "partially done" objects can be returned, thus allowing transitive dependencies to be loaded even when they would cause cycles.
If you want to have a module execute code multiple times, then export a function, and call that function.
Module Caching Caveats
Modules are cached based on their resolved filename.
Since modules may resolve to a different filename based on the location of the calling module (loading from node_modules folders), it is not a guarantee that require('foo') will always return the exact same object, if it would resolve to different files.
[http://nodejs.org/api/modules.html#modules_caching]
Description::
Member-of-module is a-semantic-unit CONTAINED by the-module.
Name::
* cpt.Ljn-m'member,
* cpt.Ljn-module-member,
Description::
The-object module.exports
is the-semantic-unit a-module exports, the-public semantic-unit of a-module.
Description::
We can-import the-public-semantic-unit of a-module, in any other module.
To do it, we use the-function require()
.
Name::
* cpt.Ljn-m'importing,
* cpt.Ljn-m'loading,
* cpt.Ljn-m'requiring,
* cpt.Ljn-m'using,
Specific::
* public-member,
* publicNo-member,
===
* __dirname-string-member,
* __filename-string-member,
* module-object-member,
* require-function-member,
Description::
Public-member-of-module is an-exported member, that we have access outside of the-module.
A-module, as a-self-executing-function, returns|exports ONLY ONE semantic-unit.
When we export many members like exports.member = value
, we export one object with members the-ones we denote in exports
.
Name::
* cpt.Ljn-m'exported-member,
* cpt.Ljn-m'public-member,
* cpt.Ljn-m'member.public,
* cpt.Ljn-m'member.localNo,
* cpt.Ljn-m'member.privateNo,
* cpt.Ljn-mmbr.public,
Description::
If module-a is importing in module-b, the-public-member of module-a is publicNo-member in module-b.
===
Defining var something
in a-module, is publicNo-member of it.
In browsers, the top-level scope is the global scope.
That means that in browsers if you're in the global scope var something will define a global variable.
In Node.js this is different.
The top-level scope is not the global scope; var something
inside an Node.js module will be local to that module.
[https://nodejs.org/api/globals.html#globals_global]
Name::
* cpt.Ljn-m'private-member,
* cpt.Ljn-m'member.private,
* cpt.Ljn-m'member.publicNo,
* cpt.Ljn-m'member.local,
Specific::
* any defined non-exporting member,
* __dirname-string-member,
* __filename-string-member,
* module-object-member,
* require-function-member,
Description::
__dirname
String
The name of the directory that the currently executing script resides in.
Example: running node example.js from /Users/mjr
console.log(__dirname);
// /Users/mjr
__dirname
isn't actually a global but rather local to each module.
[https://nodejs.org/api/globals.html#globals_dirname]
Description::
__filename
String
The filename of the code being executed.
This is the resolved absolute path of this code file.
For a main program this is not necessarily the same filename used in the command line.
The value inside a module is the path to that module file.
Example: running node example.js
from /Users/mjr
console.log(__filename);
// /Users/mjr/example.js
__filename isn't actually a global but rather local to each module.
[https://nodejs.org/api/globals.html#globals_filename]
Name::
* cpt.Ljn__filename,
* cpt.Ljn-filename,
* cpt.Ljn-filename,
Description::
The module
Object
Object
In each module, the module
free variable is a reference to the object representing the current module.
For convenience, module.exports
is also accessible via the exports
module-global.
module
isn't actually a global but rather local to each module.
[https://nodejs.org/api/modules.html#modules_the_module_object]
Name::
* cpt.Ljn-module-object,
* cpt.Ljn-mobt, {2016.07.26}
===
The-name 'module' is ambiguous.
a) denotes the-module
object, this concept.
b) denotes any module semantic-unit (ljnm).
Whole-chain::
* module-sut,
* most-whole-object (global),
Generic-chain::
* ?(Module.prototype) (module.__proto__ === Object.prototype //false
),
* Object.prototype (module.__proto__.__proto__ === Object.prototype //true
),
===
* module-sut-member,
Member::
// ljn.6-2-2
> Object.getOwnPropertyNames(module).sort()
[ 'children', 'exports', 'filename', 'id', 'loaded', 'parent', 'paths' ]
> Object.getOwnPropertyNames(module.__proto__).sort()
[ '_compile', 'constructor', 'load', 'require' ]
> Object.getOwnPropertyNames(module.__proto__.__proto__).sort()
[ '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', '__proto__', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]
Description::
module.children
Array
The module objects required by this one.
[https://nodejs.org/api/modules.html#modules_module_children]
Description::
module.exports
holds the-public-member (exported) of a-module.
===
module.exports
Object
The module.exports
object is created by the Module system.
Sometimes this is not acceptable; many want their module to be an instance of some class.
To do this, assign the desired export object to module.exports.
Note that assigning the desired object to exports will simply rebind the local exports
variable, which is probably not what you want to do.
...
exports alias
The exports
variable that is available within a module starts as a reference to module.exports.
As with any variable, if you assign a new value to it, it is no longer bound to the previous value.
[https://nodejs.org/docs/v6.3.1/api/modules.html#modules_module_exports]
Description::
When we export many members, in fact we export ONE OBJECT with members these 'many' members.
To do this we use the-code:
module.exports.member = value;
or its alias
exports.member = value;
Name::
* cpt.Ljn-exporting-many-members,
* cpt.Ljn-m'exporting-many-members,
Description::
To export a single semantic-unit we use the-code:
module.exports = value;
===
If you want the root of your module's export to be a function (such as a constructor) or if you want to export a complete object in one assignment instead of building it one property at a time, assign it to module.exports instead of exports.
[https://nodejs.org/api/modules.html#modules_modules]
Name::
* cpt.Ljn-m'exporting-single-member,
* cpt.Ljn-m'exporting-single-semantic-unit,
Description::
For convenience, module.exports
is also accessible via the exports
module-global.
[http://openmymind.net/2012/2/3/Node-Require-and-Exports/]
Name::
* cpt.Ljn-exports,
* cpt.Ljn-m'exports,
* cpt.Ljn-exports,
Description::
module.filename
String
The fully resolved filename to the module.
[https://nodejs.org/api/modules.html#modules_module_filename]
Description::
The identifier for the module. Typically this is the fully resolved filename.
[https://nodejs.org/api/modules.html#modules_module_id]
Description::
Whether or not the module is done loading, or is in the process of loading.
[https://nodejs.org/api/modules.html#modules_module_loaded]
Description::
The module that first required this one.
[https://nodejs.org/api/modules.html#modules_module_parent]
Description::
> D:\ljn>node filStart
// module.paths
[ 'D:\\ljn\\node_modules' ]
Description::
The-require-function IMPORTS modules into other modules.
When we import a-module, we import the-public-member[1] of the-module OR a-member of it[1] AND we execute the-code of the-module which could eg add a-global-member.
Name::
* cpt.Ljn-require-function,
* cpt.Ljn-f.require,
Whole-chain::
* module-semantic-unit,
* Ljn-most-whole-object (global),
Generic-chain::
* Function.prototype,
* Object.prototype,
Description::
//destructuring-assignment
const {app, BrowserWindow} = require('electron');
//equivalent
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
Description::
//just write the-module's name
const moFs = require('fs');
const mfEvents = require('events');
===
Without a leading '/' or './' to indicate a file, the module is either a "core module" or is loaded from a node_modules
folder.
[http://nodejs.org/api/modules.html#modules_file_modules]
Name::
* cpt.Ljn-import-core-module,
* cpt.Ljn-m'import-core-module,
Description::
const fDecoderString = require('string_decoder').StringDecoder;
var oDecoderString = new fDecoderString('utf8');
Name::
* cpt'ljn'import-part-of-module,
* cpt'ljnm'import-part-of-module,
Description::
//from CURRENT directory
const mFoo = require('./filFoo');
//form SUBDIRECTORY
const mC = require ('./dirTest/filC');
//from PARENT directory
const mBar = require('../filBar');
Name::
* cpt'ljn'import-module-from-relative-path,
* cpt'ljnm'import-module-from-relative-path,
Description::
A module prefixed with '/' is an absolute path to the file.
For example, require('/home/marco/foo.js')
will load the file at /home/marco/foo.js.
[http://nodejs.org/api/modules.html#modules_file_modules]
Name::
* cpt.Ljn-import-module-from-absolute-path,
* cpt.Ljn-m'import-module-from-absolute-path,
Description::
There are three ways in which you can require() files:
- using a relative path: foo = require('./lib/bar.js');
- using an absolute path: foo = require('/home/foo/lib/bar.js')
- using a search: foo = require('bar')
The first two are easy to understand.
In the third case, Node starts at the current directory, and adds ./node_modules/, and attempts to load the module from that location.
If the module is not found, then it moves to the parent directory and performs the same check, until the root of the filesystem is reached.
[http://book.mixu.net/node/single.html]
Name::
* cpt.Ljn-import-by-searching,
* cpt.Ljn-import-from-node-modules,
* cpt.Ljn-m'import-by-searching,
* cpt.Ljn-m'import-from-node-modules,
Description::
Nodejs and browserify support importing JSON files.
> oJson = require('./test.json'),
Name::
* cpt.Ljn-import-JSON-file,
* cpt.Ljn-m'import-JSON-file,
Description::
> Object.getOwnPropertyNames(require).sort()
[ 'cache', 'extensions', 'length', 'main', 'name', 'prototype', 'resolve' ]
===
> require
{ [Function: require]
resolve: [Function: resolve],
main: undefined,
extensions: { '.js': [Function], '.json': [Function], '.node': [Function] },
cache: {} }
Description::
Modules are cached in this object when they are required.
By deleting a key value from this object, the next require will reload the module.
[https://nodejs.org/api/globals.html#globals_require_cache]
Description::
Accessing the main module
When a file is run directly from Node.js, require.main
is set to its module.
That means that you can determine whether a file has been run directly by testing
require.main === module
For a file foo.js
, this will be true if run via node foo.js
, but false if run by require('./foo')
.
Because module
provides a filename
property (normally equivalent to __filename
), the entry point of the current application can be obtained by checking require.main.filename
[from any module].
[https://nodejs.org/api/modules.html#modules_accessing_the_main_module]
Description::
Use the internal require() machinery to look up the location of a module, but rather than loading the module, just return the resolved filename.
[https://nodejs.org/api/globals.html#globals_require_resolve]
Name::
* cpt.ljn-global.require.resolve,
* cpt.ljn-require.resolve,
Code.ljn:
//on a-module with 'filB.js' on the-same directory
console.log(require.resolve('./filB'))
//D:\ljn\filB.js
Description::
variables declared with the var keyword remain local to a module; those declared without it get attached to the global object.
[http://www.hacksparrow.com/global-variables-in-node-js.html]
===
Variables local to the module will be private, because the module is wrapped in a function by Node.js (see module wrapper).
[https://nodejs.org/api/modules.html]
Name::
* ljnm'variable,
* ljnm'name-value-pair,
Generic::
* Ljn-module-member,
* Ljn-name-value-pair,
Name::
* cpt.Ljn-m'repository,
* cpt.Ljn-m'storage,
Specific::
* public-repository,
* publicNo-repository,
===
* npmjs.org/
* node-modules.com/
* http://eirikb.github.io/nipster/
Description::
Join the modular development revolution
Every month, more than 4 million developers use npm to find, share, and reuse code — and assemble it in powerful new ways.
[https://www.npmjs.com/]
Name::
* cpt.Ljn-npm-registry,
* cpt.Ljn-npmjs.org,
* cpt.Ljn-npmjs.org,
npm-tool (link)
AddressWpg::
* https://www.npmjs.org/
Node Packaged Modules:
{2016.07}: 250,000 building blocks
{2014.02.16}: Total Packages: 59,377
Description::
Without a leading '/'
or './'
to indicate a file, the module is either a "core module" or is loaded from a node_modules
folder.
[https://nodejs.org/docs/v6.3.1/api/modules.html#modules_file_modules]
===
There are three ways in which you can require() files:
- using a relative path: foo = require('./lib/bar.js');
- using an absolute path: foo = require('/home/foo/lib/bar.js')
- using a search: foo = require('bar')
The first two are easy to understand.
In the third case, Node starts at the current directory, and adds ./node_modules/
, and attempts to load the module from that location.
If the module is not found, then it moves to the parent directory and performs the same check, until the root of the filesystem is reached.
[http://book.mixu.net/node/single.html]
===
When you install a-module, with npm install 'module'
, it will-put it in node_modules-directory inside your current-directory.
Name::
* cpt.Ljn-node-modules,
* cpt.Ljn-node-modules-directory,
* cpt.Ljn-node-modules-folder,
* cpt.Node-modules,
* cpt.Node-modules-directory,
* cpt.Node-modules-folder,
AddressWpg::
* http://node-modules.com/
Name::
* cpt.Ljn-m'resource,
* cpt.Ljn-module-resource,
AddressWpg::
* https://www.nczonline.net/blog/2016/04/es6-module-loading-more-complicated-than-you-think/: modules vs scripts,
* http://book.mixu.net/node/ch8.html,
* https://quickleft.com/blog/creating-and-publishing-a-node-js-module/,
* http://www.hacksparrow.com/how-to-write-node-js-modules.html,
* http://openmymind.net/2012/2/3/Node-Require-and-Exports/
Name::
* cpt.Ljn-m'converting-AMD-to-NodeJs-modules,
* cpt.Ljn-Converting-AMD-to-NodeJs-modules,
AddressWpg::
* https://github.com/millermedeiros/nodefy,
* http://corner.squareup.com/2013/02/es6-module-transpiler.html,
* https://github.com/square/es6-module-transpiler,
Name::
* cpt.Ljn-stability-index,
* cpt.Ljn-stability-index,
* cpt.Ljn-stability,
Description::
Ljnstability0.Deprecated
This feature is known to be problematic, and changes are
planned. Do not rely on it. Use of the feature may cause warnings. Backwards
compatibility should not be expected.
Ljnstability1.Experimental
This feature is subject to change, and is gated by a command line flag.
It may change or be removed in future versions.
Ljnstability2.Stable
The API has proven satisfactory.
Compatibility with the npm ecosystem
is a high priority, and will not be broken unless absolutely necessary.
Ljnstability3.Locked
Only fixes related to security, performance, or bug fixes will be accepted.
Please do not suggest API changes in this area; they will be refused.
[https://nodejs.org/api/documentation.html#documentation_stability_index]
===
The stability indices are as follows:
Stability: 0 - Deprecated
This feature is known to be problematic, and changes are
planned. Do not rely on it. Use of the feature may cause warnings. Backwards
compatibility should not be expected.
Stability: 1 - Experimental
This feature was introduced recently, and may change
or be removed in future versions. Please try it out and provide feedback.
If it addresses a use-case that is important to you, tell the node core team.
Stability: 2 - Unstable
The API is in the process of settling, but has not yet had
sufficient real-world testing to be considered stable.
Backwards-compatibility
will be maintained if reasonable.
Stability: 3 - Stable
The API has proven satisfactory, but cleanup in the underlying
code may cause minor changes. Backwards-compatibility is guaranteed.
Stability: 4 - API Frozen
This API has been tested extensively in production and is
unlikely to ever have to change.
Stability: 5 - Locked
Unless serious bugs are found, this code will not ever
change. Please do not suggest changes in this area; they will be refused.
[https://nodejs.org/docs/latest-v0.10.x/doc/api/documentation.html#documentation_stability_index]
Description::
Modules actually are (implemented as) self-executing-functions that RETURN the-semantic-unit which contains the-public-members of the-module.
[HmnSgm.2016-07-25]
===
The module wrapper
Before a module's code is executed, Node.js will wrap it with a function wrapper that looks like the following:
(function (exports, require, module, __filename, __dirname) {
// Your module code actually lives in here
});
By doing this, Node.js achieves a few things:
- It keeps top-level variables (defined with var, const or let) scoped to the module rather than the global object.
- It helps to provide some global-looking variables that are actually specific to the module, such as:
-- The module and exports objects that the implementor can use to export values from the module.
-- The convenience variables __filename and __dirname, containing the module's absolute filename and directory path.
[https://nodejs.org/api/modules.html#modules_the_module_wrapper]
Name::
* cpt.Ljn-m.specific,
* cpt.MdlNode.specific,
Specific::
* core-module,
* coreNo-module,
===
* main-module,
* mainNo-module,
===
* directory-module,
* file-module,
===
There are three types of modules in Node.js:
internal modules (parts of Node API)
3rd party modules written in javascript
3rd party modules with C/C++ addons
[https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules]
Description::
Core Modules
Node has several modules compiled into the binary.
These modules are described in greater detail elsewhere in this documentation.
The core modules are defined in node's source in the lib/ folder.
Core modules are always preferentially loaded if their identifier is passed to require().
For instance, require('http') will always return the built in HTTP module, even if there is a file by that name.
[https://nodejs.org/docs/v6.3.1/api/modules.html#modules_core_modules]
Name::
* cpt.Ljn-core-module,
* cpt.Ljn-native-module,
* cpt.Ljn-m.builtIn,
* cpt.Ljn-m.customNo,
* cpt.Ljn-m.internal,
* cpt.Ljn-m.native,
Specific::
* Ljn-m.assert,
* Ljn-m.child_process,
* Ljn-m.cluster,
* Ljn-m.crypto,
* Ljn-m.dns,
* Ljn-m.events,
* Ljn-m.fs,
* Ljn-m.http,
* Ljn-m.https,
* Ljn-m.net,
* Ljn-m.os,
* Ljn-m.path,
* Ljn-m.readline,
* Ljn-m.repl,
* Ljn-m.stream,
* Ljn-m.string_decoder,
* Ljn-m.tls,
* Ljn-m.tty,
* Ljn-m.url,
* Ljn-m.util,
* Ljn-m.vm,
* Ljn-m.zlib,
===
// ljn.6-3-1
repl> repl._builtinLibs
[ 'assert', 'buffer', 'child_process', 'cluster', 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net', 'os', 'path', 'punycode', 'querystring', 'readline', 'repl', 'stream', 'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib' ]
Description::
The assert module provides a simple set of assertion tests that can be used to test invariants.
The module is intended for internal use by Node.js, but can be used in application code via require('assert')
.
However, assert is not a testing framework, and is not intended to be used as a general purpose assertion library.
The API for the assert module is Locked.
This means that there will be no additions or changes to any of the methods implemented and exposed by the module.
[https://nodejs.org/docs/v6.3.1/api/assert.html#assert_assert]
Name::
* cpt.Ljn-assert-module,
* cpt.Ljn-assert,
* cpt.Ljn-assert,
* cpt.Ljn-m.assert,
* cpt.Ljn-mfAssert,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Function.prototype (mfAssert.__proto__ === Function.prototype //true)
* Object.prototype,
Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(mfAssert).sort()
[ 'AssertionError', 'deepEqual', 'deepStrictEqual', 'doesNotThrow', 'equal', 'fail', 'ifError', 'length', 'name', 'notDeepEqual', 'notDeepStrictEqual', 'notEqual', 'notStrictEqual', 'ok', 'prototype', 'strictEqual', 'throws' ]
Description::
Much of the Node.js core API is built around an idiomatic asynchronous event-driven architecture in which certain kinds of objects (called "emitters") periodically emit named events that cause Function objects ("listeners") to be called.
For instance: a net.Server
object emits an event each time a peer connects to it; a fs.ReadStream
emits an event when the file is opened; a stream emits an event whenever data is available to be read.
All objects that emit events are instances of the EventEmitter
class.
These objects expose an eventEmitter.on()
function that allows one or more functions to be attached to named events emitted by the object.
Typically, event names are camel-cased strings but any valid JavaScript property key can be used.
When the EventEmitter object emits an event, all of the functions attached to that specific event are called synchronously.
Any values returned by the called listeners are ignored and will be discarded.
[https://nodejs.org/docs/v6.3.1/api/events.html#events_events]
Name::
* cpt.Ljn-events-module,
* cpt.Ljn-events,
* cpt.Ljn-m.events,
* cpt.Ljn-mfEvents,
* cpt.Ljn-events-function,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Function.prototype, (mfEvents.__proto__ === Function.prototype //true)
* Object.prototype, (mfEvents.__proto__.__proto__ === Object.prototype //true)
mfEvents'Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(mfEvents).sort()
[ 'EventEmitter',
'defaultMaxListeners',
'init',
'length',
'listenerCount',
'name',
'prototype',
'usingDomains' ]
===
// mfEvents
{ [Function: EventEmitter]
EventEmitter: [Circular],
usingDomains: true,
defaultMaxListeners: [Getter/Setter],
init: [Function],
listenerCount: [Function] }
Description::
events.EventEmitter === events
[HmnSgm.2016-07-02]
===
To access the EventEmitter class, require('events').EventEmitter
.
When an EventEmitter instance experiences an error, the typical action is to emit an 'error' event.
Error events are treated as a special case in node.
If there is no listener for it, then the default action is to print a stack trace and exit the program.
All EventEmitters emit the event 'newListener
' when new listeners are added and 'removeListener
' when a listener is removed.
[https://nodejs.org/docs/v0.12.0/api/events.html#events_class_events_eventemitter]
Name::
* cpt.Ljn-mfEvents'EventEmitter,
* cpt.Ljn-EventEmitter,
* cpt.Ljn-eventEmitter,
Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(mfEvents.prototype).sort()
[ '_events', '_maxListeners', 'addListener', 'constructor', 'domain', 'emit', 'eventNames', 'getMaxListeners', 'listenerCount', 'listeners', 'on', 'once', 'prependListener', 'prependOnceListener', 'removeAllListeners', 'removeListener', 'setMaxListeners' ]
Name::
* cpt.Ljn-events.prototype,
* cpt.Ljn-mfEvents.prototype,
* cpt.Ljn-mfEvents.prototype,
Description::
Functions can then be attached to objects, to be executed when an event is emitted.
These functions are called listeners.
Inside a listener function, this
refers to the EventEmitter that the listener was attached to.
[https://nodejs.org/docs/v0.12.0/api/events.html#events_events]
Description::
A stream is an abstract interface for working with streaming data in Node.js.
The stream module provides a base API that makes it easy to build objects that implement the stream interface.
There are many stream objects provided by Node.js.
For instance, a request to an HTTP server and process.stdout are both stream instances.
Streams can be readable, writable, or both.
All streams are instances of EventEmitter.
The stream module can be accessed using:
const stream = require('stream');
While it is important for all Node.js users to understand how streams works, the stream module itself is most useful for developer's that are creating new types of stream instances.
Developer's who are primarily consuming stream objects will rarely (if ever) have need to use the stream module directly.
[https://nodejs.org/api/stream.html#stream_stream]
Name::
* cpt.Ljn-stream-module,
* cpt.Ljn-stream-functin,
* cpt.Ljn-m.stream,
* cpt.Ljn-mfStream,
* cpt.Ljn-mfStream,
* cpt.Ljn-stream,
* cpt.Ljn-stream,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Function.prototype, (mfStream.__proto__ === Function.prototype //true)
* Object.prototype (mfStream.__proto__.__proto__ === Object.prototype //true)
Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(mfStream).sort()
[ 'Duplex', 'PassThrough', 'Readable', 'Stream', 'Transform', 'Writable', 'length', 'name', 'prototype', 'super_' ]
===
> stream
{ [Function: Stream]
super_:
{ [Function: EventEmitter]
EventEmitter: [Circular],
usingDomains: true,
defaultMaxListeners: [Getter/Setter],
init: [Function],
listenerCount: [Function] },
Readable:
{ [Function: Readable]
ReadableState: [Function: ReadableState],
super_: [Circular],
_fromList: [Function: fromList] },
Writable: { [Function: Writable] WritableState: [Function: WritableState], super_: [Circular] },
Duplex:
{ [Function: Duplex]
super_:
{ [Function: Readable]
ReadableState: [Function: ReadableState],
super_: [Circular],
_fromList: [Function: fromList] } },
Transform: { [Function: Transform] super_: { [Function: Duplex] super_: [Object] } },
PassThrough: { [Function: PassThrough] super_: { [Function: Transform] super_: [Object] } },
Stream: [Circular] }
mfStream-object:
The-objects of mfStream are instances of mfEvents.prototype
.
var oStream = new mfStream();
oStream.__proto__ === mfStream.prototype //true
oStream.__proto__.__proto__ === mfEvents.prototype //true
oStream.__proto__.__proto__.__proto__ === Object.prototype //true
===
All streams are instances of EventEmitter.
[https://nodejs.org/api/stream.html#stream_stream]
Description::
The-buffer-module contains the-Buffer-function, which is and global-member.
===
The Buffer class is a global within Node.js, making it unlikely that one would need to ever use require('buffer').Buffer
.
[https://nodejs.org/docs/v6.3.1/api/buffer.html#buffer_buffer]
Name::
* cpt.Ljn-buffer-module,
* cpt.Ljn-buffer-object,
* cpt.Ljn-moBuffer,
* cpt.Ljn-m.buffer,
* cpt.Ljn-moBuffer,
* cpt.Ljn-buffer-object,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moBuffer.__proto__ === Object.prototype)
Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(moBuffer).sort()
[ 'Buffer', 'INSPECT_MAX_BYTES', 'SlowBuffer', 'kMaxLength' ]
Description::
Node provides a tri-directional popen(3) facility through the child_process module.
It is possible to stream data through a child's stdin, stdout, and stderr in a fully non-blocking way. (Note that some programs use line-buffered I/O internally.
That doesn't affect node.js but it means data you send to the child process is not immediately consumed.)
To create a child process use require('child_process').spawn()
or require('child_process').fork()
.
The semantics of each are slightly different, and explained below.
[https://nodejs.org/docs/v0.12.0/api/child_process.html#child_process_child_process]
Name::
* cpt.Ljn-child-process-module,
* cpt.Ljn-child-process,
* cpt.Ljn-child-process,
* cpt.Ljn-m.child-process,
* cpt.Ljn-moChild-process,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moChild_process.__proto__ === Object.prototype //true)
API:
* ljn.last: https://nodejs.org/api/child_process.html,
Description::
A single instance of Node.js runs in a single thread.
To take advantage of multi-core systems the user will sometimes want to launch a cluster of Node.js processes to handle the load.
[https://nodejs.org/docs/v6.3.1/api/cluster.html#cluster_cluster]
Name::
* cpt.Cluster-module,
* cpt.Ljn-cluster-module,
* cpt.Ljn-moCluster,
* cpt.Ljn-moCluster,
* cpt.Ljn-cluster,
* cpt.Ljn-cluster,
* cpt.Ljn-cluster-object,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* events.prototype (moCluster.__proto__ === mfEvents.prototype //true)
* Object.prototype (moCluster.__proto__.__proto__ === Object.prototype //true)
Description::
The crypto module provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign and verify functions.
Use require('crypto')
to access this module.
[https://nodejs.org/api/crypto.html#crypto_crypto]
Name::
* cpt.Ljn-crypto,
* cpt.Ljn-crypto,
* cpt.Ljn-m.crypto,
* cpt.Ljn-moCrypto,
* cpt.Ljn-crypto-object,
* cpt.Ljn-crypto-module,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype (moCrypto.__proto__ === Object.prototype //true)
Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(moCrypto).sort()
[ 'Certificate', 'Cipher', 'Cipheriv', 'Credentials', 'DEFAULT_ENCODING', 'Decipher', 'Decipheriv', 'DiffieHellman', 'DiffieHellmanGroup', 'Hash', 'Hmac', 'Sign', 'Verify', '_toBuf', 'constants', 'createCipher', 'createCipheriv', 'createCredentials', 'createDecipher', 'createDecipheriv', 'createDiffieHellman', 'createDiffieHellmanGroup', 'createECDH', 'createHash', 'createHmac', 'createSign', 'createVerify', 'fips', 'getCiphers', 'getCurves', 'getDiffieHellman', 'getHashes', 'pbkdf2', 'pbkdf2Sync', 'privateDecrypt', 'privateEncrypt', 'prng', 'pseudoRandomBytes', 'publicDecrypt', 'publicEncrypt', 'randomBytes', 'rng', 'setEngine' ]
Description::
The dns module contains functions belonging to two different categories:
1) Functions that use the underlying operating system facilities to perform name resolution, and that do not necessarily perform any network communication. This category contains only one function: dns.lookup().
Developers looking to perform name resolution in the same way that other applications on the same operating system behave should use dns.lookup().
...
2) Functions that connect to an actual DNS server to perform name resolution, and that always use the network to perform DNS queries.
This category contains all functions in the dns module except dns.lookup().
These functions do not use the same set of configuration files used by dns.lookup() (e.g. /etc/hosts).
These functions should be used by developers who do not want to use the underlying operating system's facilities for name resolution, and instead want to always perform DNS queries.
[https://nodejs.org/api/dns.html#dns_dns]
Name::
* cpt.Ljn-dns,
* cpt.Ljn-dns,
* cpt.Ljn-m.dns,
* cpt.Ljn-moDns,
* cpt.Ljn-dns-object,
* cpt.Ljn-dns-module,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype (moDns.__proto__ === Object.prototype //true)
Ljndns'Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moDns).sort()
[ 'ADDRCONFIG', 'ADDRGETNETWORKPARAMS', 'BADFAMILY', 'BADFLAGS', 'BADHINTS', 'BADNAME', 'BADQUERY', 'BADRESP', 'BADSTR', 'CANCELLED', 'CONNREFUSED', 'DESTRUCTION', 'EOF', 'FILE', 'FORMERR', 'LOADIPHLPAPI', 'NODATA', 'NOMEM', 'NONAME', 'NOTFOUND', 'NOTIMP', 'NOTINITIALIZED', 'REFUSED', 'SERVFAIL', 'TIMEOUT', 'V4MAPPED', 'getServers', 'lookup', 'lookupService', 'resolve', 'resolve4', 'resolve6', 'resolveCname', 'resolveMx', 'resolveNaptr', 'resolveNs', 'resolvePtr', 'resolveSoa', 'resolveSrv', 'resolveTxt', 'reverse', 'setServers' ]
===
// moDns
{ lookup: [Function: lookup],
lookupService: [Function],
resolve4: [Function: query],
resolve6: [Function: query],
resolveCname: [Function: query],
resolveMx: [Function: query],
resolveNs: [Function: query],
resolveTxt: [Function: query],
resolveSrv: [Function: query],
resolvePtr: [Function: query],
resolveNaptr: [Function: query],
resolveSoa: [Function: query],
reverse: [Function: query],
resolve: [Function],
getServers: [Function],
setServers: [Function],
ADDRCONFIG: 1024,
V4MAPPED: 2048,
NODATA: 'ENODATA',
FORMERR: 'EFORMERR',
SERVFAIL: 'ESERVFAIL',
NOTFOUND: 'ENOTFOUND',
NOTIMP: 'ENOTIMP',
REFUSED: 'EREFUSED',
BADQUERY: 'EBADQUERY',
BADNAME: 'EBADNAME',
BADFAMILY: 'EBADFAMILY',
BADRESP: 'EBADRESP',
CONNREFUSED: 'ECONNREFUSED',
TIMEOUT: 'ETIMEOUT',
EOF: 'EOF',
FILE: 'EFILE',
NOMEM: 'ENOMEM',
DESTRUCTION: 'EDESTRUCTION',
BADSTR: 'EBADSTR',
BADFLAGS: 'EBADFLAGS',
NONAME: 'ENONAME',
BADHINTS: 'EBADHINTS',
NOTINITIALIZED: 'ENOTINITIALIZED',
LOADIPHLPAPI: 'ELOADIPHLPAPI',
ADDRGETNETWORKPARAMS: 'EADDRGETNETWORKPARAMS',
CANCELLED: 'ECANCELLED' }
Description::
File I/O is provided by simple wrappers around standard POSIX functions.
To use this module do require('fs')
.
All the methods have asynchronous and synchronous forms.
The asynchronous form always take a completion callback as its last argument.
The arguments passed to the completion callback depend on the method, but the first argument is always reserved for an exception.
If the operation was completed successfully, then the first argument will be null or undefined.
When using the synchronous form any exceptions are immediately thrown.
You can use try/catch to handle exceptions or allow them to bubble up.
[https://nodejs.org/api/fs.html]
Name::
* cpt.Ljn-file-system-module,
* cpt.Ljn-fs-module,
* cpt.Ljn-fs-object,
* cpt.Ljn-m.fs,
* cpt.Ljn-moFs,
* cpt.Ljn-fs,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moFs.__proto__ === Object.prototype //true)
AddressWpg::
* https://nodejs.org/api/fs.html,
moFs'Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(moFs).sort()
[ 'F_OK', 'FileWriteStream', 'ReadStream', 'SyncWriteStream', 'WriteStream', '_stringToFlags', 'access', 'appendFile', 'chmod', 'chown', 'close', 'constants', 'createWriteStream', 'existsSync', 'fchmodSync', 'fchownSync', 'fdatasync', 'fdatasyncSync', 'fstat', 'fstatSync', 'fsync', 'fsyncSync', 'ftruncate', 'ftruncateSync', 'futimes', 'futimesSync', 'link', 'linkSync', 'lstat', 'lstatSync', 'mkdir', 'mkdirSync', 'mkdtemp', 'mkdtempSync', 'open', 'openSync', 'read', 'readFile', 'readFileSync', 'readSync', 'readdir', 'readdirSync', 'readlink', 'readlinkSync', 'realpath', 'realpathSync', 'rename', 'renameSync', 'rmdir', 'rmdirSync', 'stat', 'statSync', 'symlink', 'symlinkSync', 'truncate', 'truncateSync', 'unlink', 'unlinkSync', 'unwatchFile', 'utimes', 'utimesSync', 'watch', 'watchFile', 'write', 'writeFile', 'writeFileSync', 'writeSync' ]
===
moFs.ReadStream_Class
moFs.Stats_Class
moFs.WriteStream_Class
moFs.appendFile(filename, data, [options], callback)
moFs.appendFileSync(filename, data, [options])
moFs.chmod(path, mode, callback)
moFs.chmodSync(path, mode)
moFs.chown(path, uid, gid, callback)
moFs.chownSync(path, uid, gid)
moFs.close(fd, callback)
moFs.closeSync(fd)
moFs.createReadStream(path, [options])
moFs.createWriteStream(path, [options])
moFs.exists(path, callback)
moFs.existsSync(path)
moFs.fchmod(fd, mode, callback)
moFs.fchmodSync(fd, mode)
moFs.fchown(fd, uid, gid, callback)
moFs.fchownSync(fd, uid, gid)
moFs.fstat(fd, callback)
moFs.fstatSync(fd)
moFs.fsync(fd, callback)
moFs.fsyncSync(fd)
moFs.ftruncate(fd, len, callback)
moFs.ftruncateSync(fd, len)
moFs.futimes(fd, atime, mtime, callback)
moFs.futimesSync(fd, atime, mtime)
moFs.lchmod(path, mode, callback)
moFs.lchmodSync(path, mode)
moFs.lchown(path, uid, gid, callback)
moFs.lchownSync(path, uid, gid)
moFs.link(srcpath, dstpath, callback)
moFs.linkSync(srcpath, dstpath)
moFs.lstat(path, callback)
moFs.lstatSync(path)
moFs.mkdir(path, [mode], callback)
moFs.mkdirSync(path, [mode])
moFs.open(path, flags, [mode], callback)
moFs.openSync(path, flags, [mode])
moFs.read(fd, buffer, offset, length, position, callback)
moFs.readFile(filename, [options], callback)
moFs.readFileSync(filename, [options])
moFs.readSync(fd, buffer, offset, length, position)
moFs.readdir(path, callback)
moFs.readdirSync(path)
moFs.readlink(path, callback)
moFs.readlinkSync(path)
moFs.realpath(path, [cache], callback)
moFs.realpathSync(path, [cache])
moFs.rename(oldPath, newPath, callback)
moFs.renameSync(oldPath, newPath)
moFs.rmdir(path, callback)
moFs.rmdirSync(path)
moFs.stat(path, callback)
moFs.statSync(path)
moFs.symlink(srcpath, dstpath, [type], callback)
moFs.symlinkSync(srcpath, dstpath, [type])
moFs.truncate(path, len, callback)
moFs.truncateSync(path, len)
moFs.unlink(path, callback)
moFs.unlinkSync(path)
moFs.unwatchFile(filename, [listener])
moFs.utimes(path, atime, mtime, callback)
moFs.utimesSync(path, atime, mtime)
moFs.watch(filename, [options], [listener])
moFs.watchFile(filename, [options], listener)
moFs.write(fd, buffer, offset, length, position, callback)
moFs.writeFile(filename, data, [options], callback)
moFs.writeFileSync(filename, data, [options])
moFs.writeSync(fd, buffer, offset, length, position)
Description::
To use the HTTP server and client one must require('http')
.
The HTTP interfaces in Node are designed to support many features of the protocol which have been traditionally difficult to use.
In particular, large, possibly chunk-encoded, messages.
The interface is careful to never buffer entire requests or responses--the user is able to stream data.
HTTP message headers are represented by an object like this:
{ 'content-length': '123',
'content-type': 'text/plain',
'connection': 'keep-alive',
'host': 'mysite.com',
'accept': '*/*' }
Keys are lowercased.
Values are not modified.
In order to support the full spectrum of possible HTTP applications, Node's HTTP API is very low-level.
It deals with stream handling and message parsing only.
It parses a message into headers and body but it does not parse the actual headers or the body...
[https://nodejs.org/docs/v6.3.1/api/http.html#http_http]
Name::
* cpt.Ljn-http-module,
* cpt.Ljn-http-object,
* cpt.Ljn-m.http,
* cpt.Ljn-moHttp,
* cpt.Ljn-http,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moHttp.__proto__ === Object.prototype //true)
moHttp'Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moHttp).sort()
[ 'Agent', 'Client', 'ClientRequest', 'IncomingMessage', 'METHODS', 'OutgoingMessage', 'STATUS_CODES', 'Server', 'ServerResponse', '_connectionListener', 'createClient', 'createServer', 'get', 'globalAgent', 'request' ]
Description::
Agent:
{ [Function: Agent]
super_:
{ [Function: EventEmitter]
EventEmitter: [Circular],
usingDomains: true,
defaultMaxListeners: [Getter/Setter],
init: [Function],
listenerCount: [Function] },
defaultMaxSockets: Infinity },
Description::
ClientRequest: { [Function: ClientRequest] super_: { [Function: OutgoingMessage] super_: [Object] } },
Description::
IncomingMessage:
{ [Function: IncomingMessage]
super_:
{ [Function: Readable]
ReadableState: [Function: ReadableState],
super_: [Object],
_fromList: [Function: fromList] } },
Description::
METHODS:
[ 'ACL', 'BIND', 'CHECKOUT', 'CONNECT', 'COPY', 'DELETE', 'GET', 'HEAD', 'LINK', 'LOCK', 'M-SEARCH', 'MERGE', 'MKACTIVITY', 'MKCALENDAR', 'MKCOL', 'MOVE', 'NOTIFY', 'OPTIONS', 'PATCH', 'POST', 'PROPFIND', 'PROPPATCH', 'PURGE', 'PUT', 'REBIND', 'REPORT', 'SEARCH', 'SUBSCRIBE', 'TRACE', 'UNBIND', 'UNLINK', 'UNLOCK', 'UNSUBSCRIBE' ],
Description::
OutgoingMessage:
{ [Function: OutgoingMessage]
super_:
{ [Function: Stream]
super_: [Object],
Readable: [Object],
Writable: [Object],
Duplex: [Object],
Transform: [Object],
PassThrough: [Object],
Stream: [Circular] } },
Description::
STATUS_CODES:
{ '100': 'Continue',
'101': 'Switching Protocols',
'102': 'Processing',
'200': 'OK',
'201': 'Created',
'202': 'Accepted',
'203': 'Non-Authoritative Information',
'204': 'No Content',
'205': 'Reset Content',
'206': 'Partial Content',
'207': 'Multi-Status',
'208': 'Already Reported',
'226': 'IM Used',
'300': 'Multiple Choices',
'301': 'Moved Permanently',
'302': 'Found',
'303': 'See Other',
'304': 'Not Modified',
'305': 'Use Proxy',
'307': 'Temporary Redirect',
'308': 'Permanent Redirect',
'400': 'Bad Request',
'401': 'Unauthorized',
'402': 'Payment Required',
'403': 'Forbidden',
'404': 'Not Found',
'405': 'Method Not Allowed',
'406': 'Not Acceptable',
'407': 'Proxy Authentication Required',
'408': 'Request Timeout',
'409': 'Conflict',
'410': 'Gone',
'411': 'Length Required',
'412': 'Precondition Failed',
'413': 'Payload Too Large',
'414': 'URI Too Long',
'415': 'Unsupported Media Type',
'416': 'Range Not Satisfiable',
'417': 'Expectation Failed',
'418': 'I\'m a teapot',
'421': 'Misdirected Request',
'422': 'Unprocessable Entity',
'423': 'Locked',
'424': 'Failed Dependency',
'425': 'Unordered Collection',
'426': 'Upgrade Required',
'428': 'Precondition Required',
'429': 'Too Many Requests',
'431': 'Request Header Fields Too Large',
'451': 'Unavailable For Legal Reasons',
'500': 'Internal Server Error',
'501': 'Not Implemented',
'502': 'Bad Gateway',
'503': 'Service Unavailable',
'504': 'Gateway Timeout',
'505': 'HTTP Version Not Supported',
'506': 'Variant Also Negotiates',
'507': 'Insufficient Storage',
'508': 'Loop Detected',
'509': 'Bandwidth Limit Exceeded',
'510': 'Not Extended',
'511': 'Network Authentication Required' },
Description::
Server: { [Function: Server] super_: { [Function: Server] super_: [Object] } },
Description::
ServerResponse: { [Function: ServerResponse] super_: { [Function: OutgoingMessage] super_: [Object] } },
Description::
_connectionListener: [Function: connectionListener],
Description::
globalAgent:
Agent {
domain:
Domain {
domain: null,
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
members: [] },
_events: { free: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 80,
protocol: 'http:',
options: { path: null },
requests: {},
sockets: {},
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256 },
Description::
HTTPS is the HTTP protocol over TLS/SSL.
In Node.js this is implemented as a separate module.
[https://nodejs.org/docs/v6.3.1/api/https.html#https_https]
Name::
* cpt.Ljn-https-module,
* cpt.Ljn-https-object,
* cpt.Ljn-m.https,
* cpt.Ljn-moHttps,
* cpt.Ljn-https,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moHttps.__proto__ === Object.prototype //true)
moHttps'Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moHttps).sort()
[ 'Agent',
'Server',
'createServer',
'get',
'globalAgent',
'request' ]
===
// moHttps
{ Server: { [Function: Server] super_: { [Function: Server] super_: [Object] } },
createServer: [Function],
globalAgent:
Agent {
domain:
Domain {
domain: null,
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
members: [] },
_events: { free: [Function] },
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: { path: null },
requests: {},
sockets: {},
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: { map: {}, list: [] } },
Agent:
{ [Function: Agent]
super_: { [Function: Agent] super_: [Object], defaultMaxSockets: Infinity } },
request: [Function],
get: [Function] }
Description::
The net module provides you with an asynchronous network wrapper.
It contains functions for creating both servers and clients (called streams).
You can include this module with require('net');
.
[https://nodejs.org/docs/v6.3.1/api/net.html#net_net]
Name::
* cpt.Ljn-net-module,
* cpt.Ljn-net-object,
* cpt.Ljn-m.net,
* cpt.Ljn-moNet,
* cpt.Ljn-net,
* cpt.Ljn-net,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moNet.__proto__ === Object.prototype //true)
Ljnnet'Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moNet).sort()
[ 'Server', 'Socket', 'Stream', '_createServerHandle', '_normalizeConnectArgs', '_setSimultaneousAccepts', 'connect', 'createConnection', 'createServer', 'isIP', 'isIPv4', 'isIPv6' ]
===
// moNet
{ createServer: [Function],
createConnection: [Function],
connect: [Function],
_normalizeConnectArgs: [Function: normalizeConnectArgs],
Socket: { [Function: Socket] super_: { [Function: Duplex] super_: [Object] } },
Stream: { [Function: Socket] super_: { [Function: Duplex] super_: [Object] } },
Server:
{ [Function: Server]
super_:
{ [Function: EventEmitter]
EventEmitter: [Circular],
usingDomains: true,
defaultMaxListeners: [Getter/Setter],
init: [Function],
listenerCount: [Function] } },
_createServerHandle: [Function: createServerHandle],
isIP: [Function: isIP],
isIPv4: [Function],
isIPv6: [Function],
_setSimultaneousAccepts: [Function] }
Description::
The os module provides a number of operating system-related utility methods.
It can be accessed using:
const os = require('os');
[https://nodejs.org/docs/v6.3.1/api/os.html#os_os]
Name::
* cpt.Ljn-os-module,
* cpt.Ljn-os-object,
* cpt.Ljn-m.os,
* cpt.Ljn-moOs,
* cpt.Ljn-os,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moOs.__proto__ === Object.prototype //true)
Ljnos'Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moOs).sort()
[ 'EOL', 'arch', 'cpus', 'endianness', 'freemem', 'getNetworkInterfaces', 'homedir', 'hostname', 'loadavg', 'networkInterfaces', 'platform', 'release', 'tmpDir', 'tmpdir', 'totalmem', 'type', 'uptime', 'userInfo' ]
===
// moOs
{ hostname: [Function: getHostname],
loadavg: [Function: getLoadAvg],
uptime: [Function: getUptime],
freemem: [Function: getFreeMem],
totalmem: [Function: getTotalMem],
cpus: [Function: getCPUs],
type: [Function: getOSType],
release: [Function: getOSRelease],
networkInterfaces: [Function: getInterfaceAddresses],
homedir: [Function: getHomeDirectory],
userInfo: [Function: getUserInfo],
arch: [Function],
platform: [Function],
tmpdir: [Function],
tmpDir: [Function],
getNetworkInterfaces: [Function: deprecated],
EOL: '\r\n',
endianness: [Function] }
Description::
The path module provides utilities for working with file and directory paths.
It can be accessed using:
const path = require('path');
[https://nodejs.org/docs/v6.3.1/api/path.html#path_path]
Name::
* cpt.Ljn-path-module,
* cpt.Ljn-path-object,
* cpt.Ljn-m.path,
* cpt.Ljn-moPath,
* cpt.Ljn-path,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moPath.__proto__ === Object.prototype //true)
Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moPath).sort()
[ '_makeLong', 'basename', 'delimiter', 'dirname', 'extname', 'format', 'isAbsolute', 'join', 'normalize', 'parse', 'posix', 'relative', 'resolve', 'sep', 'win32' ]
Description::
The readline module provides an interface for reading data from a Readable stream (such as process.stdin
) one line at a time.
It can be accessed using:
const readline = require('readline')
;
The following simple example illustrates the basic use of the readline module.
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('What do you think of Node.js? ', (answer) => {
// TODO: Log the answer in a database
console.log('Thank you for your valuable feedback:', answer);
rl.close();
});
Note Once this code is invoked, the Node.js application will not terminate until the readline.Interface is closed because the interface waits for data to be received on the input stream.
[https://nodejs.org/docs/v6.3.1/api/readline.html#readline_readline]
Name::
* cpt.Ljn-readline-module,
* cpt.Ljn-readline-object,
* cpt.Ljn-m.readline,
* cpt.Ljn-moReadline,
* cpt.Ljn-readline,
* cpt.Ljn-readline,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moReadline.__proto__ === Object.prototype //true)
Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moReadline).sort()
[ 'Interface', 'clearLine', 'clearScreenDown', 'codePointAt', 'createInterface', 'cursorTo', 'emitKeypressEvents', 'getStringWidth', 'isFullWidthCodePoint', 'moveCursor', 'stripVTControlCharacters' ]
Description::
The string_decoder module provides an API for decoding Buffer objects into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 characters.
It can be accessed using:
const StringDecoder = require('string_decoder').StringDecoder;
The following example shows the basic use of the StringDecoder class.
const StringDecoder = require('string_decoder').StringDecoder;
const decoder = new StringDecoder('utf8');
const cent = Buffer.from([0xC2, 0xA2]);
console.log(decoder.write(cent));
const euro = Buffer.from([0xE2, 0x82, 0xAC]);
console.log(decoder.write(euro));
[https://nodejs.org/docs/v6.3.1/api/string_decoder.html#string_decoder_stringdecoder]
Name::
* cpt.Ljn-string-decoder-module,
* cpt.Ljn-m.string-decoder,
* cpt.Ljn-moString-decoder,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moString_decoder.__proto__ === Object.prototype //true)
Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moString_decoder).sort()
[ 'StringDecoder' ]
Description::
The tls module provides an implementation of the Transport Layer Security (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
The module can be accessed using:
const tls = require('tls');
[https://nodejs.org/docs/v6.3.1/api/tls.html#tls_tls_ssl]
Name::
* cpt.Ljn-tls-module,
* cpt.Ljn-tls-object,
* cpt.Ljn-m.tls,
* cpt.Ljn-moTls,
* cpt.Ljn-tls,
* cpt.Ljn-tls,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moTls.__proto__ === Object.prototype //true)
Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moTls).sort()
[ 'CLIENT_RENEG_LIMIT', 'CLIENT_RENEG_WINDOW', 'DEFAULT_CIPHERS', 'DEFAULT_ECDH_CURVE', 'SLAB_BUFFER_SIZE', 'SecureContext', 'Server', 'TLSSocket', 'checkServerIdentity', 'connect', 'convertALPNProtocols', 'convertNPNProtocols', 'createSecureContext', 'createSecurePair', 'createServer', 'getCiphers', 'parseCertString' ]
Description::
The url module provides utilities for URL resolution and parsing.
It can be accessed using:
const url = require('url');
[https://nodejs.org/docs/v6.3.1/api/url.html#url_url]
Name::
* cpt.Ljn-url-module,
* cpt.Ljn-url-object,
* cpt.Ljn-m.url,
* cpt.Ljn-moUrl,
* cpt.Ljn-url,
* cpt.Ljn-url,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moUrl.__proto__ === Object.prototype //true)
Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moUrl).sort()
[ 'Url', 'format', 'parse', 'resolve', 'resolveObject' ]
Description::
These functions are in the module 'util'.
Use require('util')
to access them.
[https://nodejs.org/api/util.html]
Name::
* cpt.Ljn-util-module,
* cpt.Ljn-util-object,
* cpt.Ljn-m.util,
* cpt.Ljn-moUtil,
* cpt.Ljn-util,
* cpt.Ljn-util,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moUtil.__proto__ === Object.prototype //true)
Ljnutil'Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moUtil).sort()
[ '_errnoException', '_exceptionWithHostPort', '_extend', 'debug', 'debuglog', 'deprecate', 'error', 'format', 'inherits', 'inspect', 'isArray', 'isBoolean', 'isBuffer', 'isDate', 'isError', 'isFunction', 'isNull', 'isNullOrUndefined', 'isNumber', 'isObject', 'isPrimitive', 'isRegExp', 'isString', 'isSymbol', 'isUndefined', 'log', 'print', 'puts' ]
===
moUtil.format(format, [...])
moUtil.debug(string)
moUtil.error([...])
moUtil.puts([...])
moUtil.print([...])
moUtil.log(string)
moUtil.inspect(object, [options])
moUtil.isArray(object)
moUtil.isRegExp(object)
moUtil.isDate(object)
moUtil.isError(object)
moUtil.pump(readableStream, writableStream, [callback])
moUtil.inherits(constructor, superConstructor)
Description::
The vm module provides APIs for compiling and running code within V8 Virtual Machine contexts.
It can be accessed using:
const vm = require('vm');
javascript code can be compiled and run immediately or compiled, saved, and run later.
[https://nodejs.org/docs/v6.3.1/api/vm.html#vm_executing_javascript]
Name::
* cpt.Ljn-vm-module,
* cpt.Ljn-vm-object,
* cpt.Ljn-m.vm,
* cpt.Ljn-moVm,
* cpt.Ljn-vm,
* cpt.Ljn-vm,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moVm.__proto__ === Object.prototype //true)
Ljn-moVm'Member::
// ljn.6-2-2
// Object.getOwnPropertyNames(moVm).sort()
[ 'Script', 'createContext', 'createScript', 'isContext', 'runInContext', 'runInDebugContext', 'runInNewContext', 'runInThisContext' ]
Description::
The zlib module provides compression functionality implemented using Gzip and Deflate/Inflate.
It can be accessed using:
const zlib = require('zlib');
[https://nodejs.org/docs/v6.3.1/api/zlib.html#zlib_zlib]
Name::
* cpt.Ljn-zlib-module,
* cpt.Ljn-zlib-object,
* cpt.Ljn-m.zlib,
* cpt.Ljn-moZlib,
* cpt.Ljn-zlib,
* cpt.Ljn-zlib,
Whole-chain::
* module-instance,
* most-whole-object (global),
Generic-chain::
* Object.prototype, (moZlib.__proto__ === Object.prototype //true)
Member::
// ljn.6-3-1
// Object.getOwnPropertyNames(moZlib).sort()
[ 'Deflate', 'Gunzip', 'Inflate', 'Unzip', 'ZLIB_VERSION', 'Z_BEST_SPEED', 'Z_BUF_ERROR', 'Z_DEFAULT_CHUNK', 'Z_DEFAULT_LEVEL', 'Z_DEFAULT_STRATEGY', 'Z_ERRNO', 'Z_FINISH', 'Z_FULL_FLUSH', 'Z_MAX_CHUNK', 'Z_MAX_MEMLEVEL', 'Z_MEM_ERROR', 'Z_MIN_LEVEL', 'Z_MIN_WINDOWBITS', 'Z_NO_COMPRESSION', 'Z_OK', 'Z_RLE', 'Z_STREAM_ERROR', 'Z_VERSION_ERROR', 'codes', 'createDeflateRaw', 'createGzip', 'createInflateRaw', 'deflate', 'deflateRawSync', 'gunzip', 'gzip', 'inflate', 'inflateRawSync', 'unzip', 'unzipSync' ]
Description::
CoreNo-module is a-module created by the-language-creator|s.
Name::
* cpt.Ljn-coreNo-module,
* cpt.Ljn-non-native-module,
* cpt.Ljn-m.3rd-party,
* cpt.Ljn-m.non-builtIn,
* cpt.Ljn-m.custom,
* cpt.Ljn-m.internalNo,
* cpt.Ljn-m.nativeNo,
Specific::
* 3rd party modules written in javascript
* 3rd party modules with C/C++ addons
[https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules]
Description:
It is convenient to organize programs and libraries into self-contained directories, and then provide a single entry point to that library.
[https://nodejs.org/docs/v6.3.1/api/modules.html#modules_folders_as_modules]
Name::
* cpt.Ljn-directory-module,
* cpt.Ljn-folder-module,
* cpt.Ljn-m.directory,
* cpt.Ljn-m.folder,
Description::
Folders as Modules
It is convenient to organize programs and libraries into self-contained directories, and then provide a single entry point to that library. There are three ways in which a folder may be passed to require() as an argument.
The first is to create a package.json
file in the root of the folder, which specifies a main module.
An example package.json file might look like this:
{ "name" : "some-library",
"main" : "./lib/some-library.js" }
If this was in a folder at ./some-library, then require('./some-library') would attempt to load ./some-library/lib/some-library.js.
This is the extent of Node's awareness of package.json files.
Note: If the file specified by the "main" entry of package.json is missing and can not be resolved, Node.js will report the entire module as missing with the default error:
Error: Cannot find module 'some-library'
If there is no package.json file present in the directory, then node will attempt to load an index.js
or index.node
file out of that directory.
For example, if there was no package.json file in the above example, then require('./some-library') would attempt to load:
./some-library/index.js
./some-library/index.node
[https://nodejs.org/docs/v6.3.1/api/modules.html#modules_folders_as_modules]
===
Directories as modules
You can organize your modules into directories, as long as you provide a point of entry for Node.
The easiest way to do this is to create the directory ./node_modules/mymodulename/, and put an index.js file in that directory.
The index.js file will be loaded by default.
Alternatively, you can put a package.json file in the mymodulename folder, specifying the name and main file of the module:
{
"name": "mymodulename",
"main": "./lib/foo.js"
}
This would cause the file ./node_modules/mymodulename/lib/foo.js to be returned from require('mymodulename').
Generally, you want to keep a single ./node_modules
folder in the base directory of your app.
You can install new modules by adding files or directories to ./node_modules.
The best way to manage these modules is to use npm, which is covered briefly in the next section.
[http://book.mixu.net/node/single.html]
Name::
* cpt.Ljn-file-module,
* cpt.Ljn-m.file,
Description::
File Modules
If the exact filename is not found, then node will attempt to load the required filename with the added extension of .js, .json, and then .node.
.js files are interpreted as javascript text files, and .json files are parsed as JSON text files.
.node files are interpreted as compiled addon modules loaded with dlopen
.
A module prefixed with '/' is an absolute path to the file.
For example, require('/home/marco/foo.js') will load the file at /home/marco/foo.js.
A module prefixed with './' is relative to the file calling require().
That is, circle.js must be in the same directory as foo.js for require('./circle') to find it.
Without a leading '/' or './' to indicate a file, the module is either a "core module" or is loaded from a node_modules
folder.
If the given path does not exist, require() will throw an Error with its code property set to 'MODULE_NOT_FOUND
'.
[https://nodejs.org/docs/v6.3.1/api/modules.html#modules_file_modules]
Description::
Main-module is a-module from which STARTS a-program or a-library.
Name::
* cpt.Ljn-entry-point-module,
* cpt.Ljn-main-module,
* cpt.Ljn-m.main,
Accessing the-main-module:
(link)
Description::
Dependent-module is any module importing in another.
Name::
* cpt.Ljn-dependent-module,
* cpt.Ljn-mainNo-module,
* cpt.Ljn-m.mainNo,
Generic::
* Ljs-native-api,
Name::
* cpt.Ljn-API.native,
* cpt.Ljn-native-API,
Description::
The-builtin-semantic-units have many relations.
The-whole-part-relations create a-whole-part-tree with 'global' the-most-whole-node.
[HmnSgm.2016-07-02]
Name::
* cpt.Ljn-apiNtv'whole-part-tree,
* cpt.Ljn-apiNtv'whole-part-tree,
* cpt.Ljn-native-whole-part-tree,
* cpt.Ljn-wpt,
* cpt.Ljn-wpt,
Whole-part-tree:
Description::
The native API[1] of Ljn is-structured AND in a-generic-specific-tree because of the-inheritance (generic-specific) relations of its[1] members.
Object.prototype is the most generic object, like the-ljb-generic-specific-tree.
Name::
* cpt.Ljn-API's-generic-specific-tree,
* cpt.Ljn-aPI's-generic-specific-tree,
* cpt.Ljn-generic-specific-tree,
* cpt.Ljn-generic-specific-tree,
* cpt.Ljn-native-generic-specific-tree,
* cpt.Ljn-native-generic-specific-tree,
* cpt.Ljn-gst,
* cpt.Ljn-gst,
* cpt.Ljn-inheritance-tree,
* cpt.Ljn-inheritance-tree,
Ljn'Generic-specific-tree of Ljn native-API:
> Array.prototype.__proto__ === Object.prototype //true
),> Object.getPrototypeOf(Intl) === Object.prototype //true
),Description:
global
is the most whole object in Ljn-API's-whole-part-tree.
In Ljb the most whole object is the-window
.
The-members of the-global-object are-called also 'globals'.
[HmnSgm.2016-07-04]
Name::
* cpt.Ljn-global-namespace,
* cpt.Ljn-global-object,
* cpt.Ljn-global-scope,
* cpt.Ljn-global,
* cpt.Ljn-most-whole-object,
* cpt.Ljn-object.global,
* cpt.Ljn-the-global-object,
* cpt.Ljn-gbl, {2016.07.01}
* cpt.Ljn-global,
* cpt.Ljn-global-scope,
* cpt.Ljn-global-namespace,
* cpt.Ljn-mwo, {2016.07.22}
===
DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
Description::
Node module has a number of variables which are available by default.
These are documented in the API docs: globals and process.
[http://book.mixu.net/node/single.html]
===
The global object is determined by the execution environment.
It is the window object in a web browser and the process object in a NodeJS script.
[http://rainsoft.io/gentle-explanation-of-this-in-javascript/]
===
global
{Object} The global namespace object.
In browsers, the top-level scope is the global scope.
That means that in browsers if you're in the global scope var something
will define a global variable.
In Node this is different.
The top-level scope is not the global scope; var something inside a Node module will be local to that module.
[https://nodejs.org/docs/v6.3.1/api/globals.html#globals_global]
===
the global object, which is "DomWindow" in the browser and "global" in Node.
[http://book.mixu.net/node/single.html]
===
Unlike the browser, Node does not have a window global object, but instead has two others: globals and process.
[https://www.airpair.com/javascript/node-js-tutorial#3-1-modules]
Generic-chain::
* global.__proto__ (?)
* Object.prototype (> global.__proto__.__proto__ === Object.prototype //true)
===
The-global
is a-specific of Object.prototype
.
Description::
The-members of the-most-whole-object (global) are-called >>>ALSO<<< 'globals'.
[HmnSgm.2016-07-02]
'the-global' = the-most-whole-object.
'a-global' = a-member of the-global.
[HmnSgm.2017-01-07]
===
These objects are available in all modules.
Some of these objects aren't actually in the global scope but in the module scope - this will be noted.
[https://nodejs.org/api/globals.html]
===
Node module has a number of variables which are available by default.
These are documented in the API docs: globals and process.
[http://book.mixu.net/node/single.html]
===
Node is a javascript environment running in Google's V8 javascript engine.
As such, we should follow the best practices that we use for client-side development.
For example, we should avoid putting anything into the global scope.
That, however, is not always possible.
The global scope in Node is GLOBAL (as opposed to window in the browser), and you can easily create a global variable of function by omitting the var keyword, like this:
globalVariable = 1;
globalFunction = function () { ... };
Once again, globals should be avoided whenever possible.
So be careful and remember to use var when declaring a variable.
[http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/]
Name::
* cpt.Ljn-a-global-object,
* cpt.Ljn-global-member,
* cpt.Ljn-global-objects,
* cpt.Ljn-globals,
* cpt.Ljn-global-member,
* cpt.Ljn-global-objects,
* cpt.Ljn-globals,
SPECIFIC:
// ljn.6-3-1
> Object.getOwnPropertyNames(global).sort()
[ 'Array', 'ArrayBuffer', 'Boolean', 'Buffer', 'COUNTER_HTTP_CLIENT_REQUEST', 'COUNTER_HTTP_CLIENT_RESPONSE', 'COUNTER_HTTP_SERVER_REQUEST', 'COUNTER_HTTP_SERVER_RESPONSE', 'COUNTER_NET_SERVER_CONNECTION', 'COUNTER_NET_SERVER_CONNECTION_CLOSE', 'DTRACE_HTTP_CLIENT_REQUEST', 'DTRACE_HTTP_CLIENT_RESPONSE', 'DTRACE_HTTP_SERVER_REQUEST', 'DTRACE_HTTP_SERVER_RESPONSE', 'DTRACE_NET_SERVER_CONNECTION', 'DTRACE_NET_STREAM_END', 'DataView', 'Date', 'Error', 'EvalError', 'Float32Array', 'Float64Array', 'Function', 'GLOBAL', 'Infinity', 'Int16Array', 'Int32Array', 'Int8Array', 'Intl', 'JSON', 'Map', 'Math', 'NaN', 'Number', 'Object', 'Promise', 'Proxy', 'RangeError', 'ReferenceError', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'SyntaxError', 'TypeError', 'URIError', 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray', 'WeakMap', 'WeakSet', 'clearImmediate', 'clearInterval', 'clearTimeout', 'console', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape', 'eval', 'global', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'process', 'root', 'setImmediate', 'setInterval', 'setTimeout', 'undefined', 'unescape' ]
Name::
* cpt.ArrayBuffer,
* cpt.Ljn-ArrayBuffer,
* cpt.Ljn-arrayBuffer,
Whole-chain::
* global,
Generic-chain::
* Function.prototype (> Object.getPrototypeOf(ArrayBuffer) === Function.prototype //true
)
* Object.prototype,
LjnArrayBuffer'Member::
// ljn.6-2-2
> Object.getOwnPropertyNames(ArrayBuffer).sort()
[ 'arguments', 'caller', 'isView', 'length', 'name', 'prototype' ]
> Object.getOwnPropertyNames(ArrayBuffer.prototype).sort()
[ 'byteLength', 'constructor', 'slice' ]
> Object.getOwnPropertyNames(ArrayBuffer.prototype.__proto__).sort()
[ '__defineGetter__',
'__defineSetter__',
'__lookupGetter__',
'__lookupSetter__',
'__proto__',
'constructor',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toLocaleString',
'toString',
'valueOf' ]
LjnArrayBuffer.prototype'Member::
// ljn.6-2-2
> Object.getOwnPropertyNames(ArrayBuffer.prototype).sort()
[ 'byteLength', 'constructor', 'slice' ]
Name::
* cpt.Ljn-Buffer-function,
* cpt.Ljn-Buffer-class,
Description::
The Buffer class is a global type for dealing with binary data directly.
It can be constructed in a variety of ways
[https://nodejs.org/api/buffer.html#buffer_class_buffer]
===
Pure javascript is Unicode friendly but not nice to binary data.
When dealing with TCP streams or the file system, it's necessary to handle octet streams.
Node has several strategies for manipulating, creating, and consuming octet streams.
Raw data is stored in instances of the Buffer class.
A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap.
A Buffer cannot be resized.
The Buffer class is a global, making it very rare that one would need to ever require('buffer').
Converting between Buffers and javascript string objects requires an explicit encoding method.
[https://nodejs.org/api/buffer.html]
Description::
Node provides a global 'console' object to which you can output strings using:
console.log('Hello');
[http://nodetuts.com/pdf/handson-nodejs-sample.pdf]
===
The console module provides a simple debugging console that is similar to the javascript console mechanism provided by web browsers.
The module exports two specific components:
A Console class with methods such as console.log(), console.error() and console.warn() that can be used to write to any Node.js stream.
A global console instance configured to write to stdout and stderr.
Because this object is global, it can be used without calling require('console')
.
[https://nodejs.org/docs/v6.3.1/api/console.html#console_console]
Name::
* cpt.Ljn-console,
* cpt.Ljn-console,
* cpt.Ljn-console-object,
* cpt.Ljn-console-object,
Whole.chain:
* Ljn-most-whole-object (global),
Generic-chain::
* Console.prototype, (> console.__proto__ === console.Console.prototype)
* Object.prototype, (> console.__proto__.__proto__ === Object.prototype //true)
Description::
The process object is a global object and can be accessed from anywhere.
It is an instance of EventEmitter.
[https://nodejs.org/docs/v6.0.0/api/process.html#process_process]
Name::
* cpt.Ljn-process-object,
* cpt.Ljn-m.process,
* cpt.Ljn-global.process,
* cpt.Ljn-process,
Whole-chain::
* global,
Generic-chain::
* (process.__proto__)
* events.EventEmitter.prototype (> process.__proto__.__proto__ === events.EventEmitter.prototype //true)
* Object.prototype (> process.__proto__.__proto__.__proto__ === Object.prototype //true)
API:
* ljn.last: https://nodejs.org/api/process.html,
Ljnprocess'Member::
//{ljn.6-2-2}
> Object.getOwnPropertyNames(process).sort()
[ 'EventEmitter', '_debugEnd', '_debugPause', '_debugProcess', '_events', '_eventsCount', '_exiting', '_fatalException', '_getActiveHandles', '_getActiveRequests', '_kill', '_linkedBinding', '_maxListeners', '_needImmediateCallback', '_promiseRejectEvent', '_rawDebug', '_startProfilerIdleNotifier', '_stopProfilerIdleNotifier', '_tickCallback', '_tickDomainCallback', 'abort', 'arch', 'argv', 'assert', 'binding', 'chdir', 'config', 'cpuUsage', 'cwd', 'debugPort', 'dlopen', 'domain', 'emitWarning', 'env', 'execArgv', 'execPath', 'exit', 'features', 'hrtime', 'kill', 'memoryUsage', 'moduleLoadList', 'nextTick', 'openStdin', 'pid', 'platform', 'reallyExit', 'release', 'stderr', 'stdin', 'stdout', 'title', 'umask', 'uptime', 'version', 'versions' ]
===
> Object.getOwnPropertyNames(process.__proto__)
[ 'constructor' ]
> Object.getOwnPropertyNames(process.__proto__.__proto__)
[ 'constructor', 'domain', '_events', '_maxListeners', 'setMaxListeners', 'getMaxListeners', 'emit', 'addListener', 'on', 'prependListener', 'once', 'prependOnceListener', 'removeListener', 'removeAllListeners', 'listeners', 'listenerCount', 'eventNames' ]
> Object.getOwnPropertyNames(process.__proto__.__proto__.__proto__)
[ 'constructor', 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', '__defineGetter__', '__lookupGetter__', '__defineSetter__', '__lookupSetter__', '__proto__' ]
Description::
An array containing the command line arguments.
The first element will be 'node', the second element will be the name of the javascript file.
The next elements will be any additional command line arguments.
// print process.argv
process.argv.forEach(function(val, index, array) {
console.log(index + ': ' + val);
});
This will generate:
$ node process-2.js one two=three four
0: node
1: /Users/mjr/work/node/process-2.js
2: one
3: two=three
4: four
[http://nodejs.org/api/process.html#process_process_argv]
Name::
* cpt.Command-line-arguments-of-Node.js-program,
* cpt.Ljn-pgm'command-line-arguments,
* cpt.Ljn-pgm'arguments,
* cpt.Ljn-process.argv,
* cpt.Ljn-process.argv-array,
* cpt.Ljn-process.argv,
* cpt.Ljn-process.argv-array,
* cpt.Process.argv,
> process.versions
{ http_parser: '2.7.0',
node: '6.2.2',
v8: '5.0.71.52',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '57.1',
modules: '48',
openssl: '1.0.2h' }
Description::
All of the timer functions are globals.
You do not need to require() this module in order to use them.
[https://nodejs.org/docs/v6.3.1/api/timers.html#timers_timers]
Name::
* cpt.Ljn-timer-functions,
* cpt.Ljn-timers,
* cpt.Ljn-timer-functions,
* cpt.Ljn-timers,
Generic::
* Ljs-phrase,
Name::
* cpt.Ljn-frs,
* cpt.Ljn-phrase,
* cpt.Ljn-frs,
* cpt.Ljn-phrase,
Generic::
* Ljs-sentence,
Name::
* cpt.Ljn-sentence,
* cpt.Ljn-stc,
* cpt.Ljn-sentence,
* cpt.Ljn-stc,
Generic::
* Ljs-root-tree,
Name::
* cpt.Ljn-algo-root-tree,
* cpt.Ljn-algo-root-tree,
* cpt.Ljn-algo-root,
Description::
The-root-tree is the-main-module.
Name::
* cpt.Ljn-algo.specific,
* cpt.Ljn-algo.specific,
Specific::
Node.js is an extremely powerful and flexible technology that can solve a wide variety of problems.
I want everyone to remember that Node.js is only bound by your imagination.
The core libraries are very carefully designed to provide the puzzle pieces needed to build any picture.
Combine those with the modules available in npm and it's amazing how quickly you can begin building very complex and compelling applications.
[http://blog.modulus.io/absolute-beginners-guide-to-nodejs]
Name::
* cpt.Ljn-asynchronous,
AddressWpg::
* {2017-07-05} https://blog.risingstack.com/mastering-async-await-in-nodejs/,
Name::
* cpt.Ljn-authentication,
AddressWpg::
* http://passportjs.org/
* http://www.sitepoint.com/http-authentication-in-node-js/
Description::
The file system functions consist of file I/O and directory I/O functions.
All of the file system functions offer both synchronous (blocking) and asynchronous (non-blocking) versions.
The difference between these two is that the synchronous functions (which have “Sync” in their name) return the value directly and prevent Node from executing any code while the I/O operation is being performed
[http://book.mixu.net/node/single.html]
Name::
* cpt.Ljn-file-system-processing,
* cpt.Ljn-processing.FILE-SYSTEM,
* cpt.Ljn-algo.fs,
* cpt.Ljn-algo.fs,
AddressWpg::
* http://www.sitepoint.com/accessing-the-file-system-in-node-js/
* https://www.npmjs.org/package/delivery,
Module:
* fs-module,
* path-module,
Description::
The file system functions consist of file I/O and directory I/O functions.
All of the file system functions offer both synchronous (blocking) and asynchronous (non-blocking) versions.
The difference between these two is that the synchronous functions (which have “Sync” in their name) return the value directly and prevent Node from executing any code while the I/O operation is being performed:
var fs = require('fs');
var data = fs.readFileSync('./index.html', 'utf8');
// wait for the result, then use it
console.log(data);
Asynchronous functions return the value as a parameter to a callback given to them:
var fs = require('fs');
fs.readFile('./index.html', 'utf8', function(err, data) {
// the data is passed to the callback in the second argument
console.log(data);
});
...
You should use the asynchronous version in most cases, but in rare cases (e.g. reading configuration files when starting a server) the synchronous version is more appropriate.
Note that the asynchronous versions require a bit more thought, since the operations are started immediately and may finish in any order:
fs.readFile('./file.html', function (err, data) {
// ...
});
fs.readFile('./other.html', function (err, data) {
// ..
});
These file reads might complete in any order depending on how long it takes to read each file.
The simplest solution is to chain the callbacks:
fs.readFile('./file.html', function (err, data) {
// ...
fs.readFile('./other.html', function (err, data) {
// ...
});
});
[http://book.mixu.net/node/single.html]
Code.ljn:
//READ text file into an-array per line
var
moFs = require('fs'),
aOut;
aOut = moFs.readFileSync(sFileIn).toString().split('\n')
[hmnSgm.2017-06-04]
Code.ljn:
//READ json-file
var
moFs = require('fs'),
oOut;
oOut = JSON.parse(moFs.readFileSync(sFilIn))
[hmnSgm.2017-06-04]
AddressWpg::
* http://www.hongkiat.com/blog/node-js-server-side-javascript/,
AddressWpg::
* http://www.componentix.com/blog/13/file-uploads-using-nodejs-once-again,
Code.ljn:
var fs = require('fs');
var myData = {
name:'test',
version:'1.0'
}
var outputFilename = '/tmp/my.json';
fs.writeFile(outputFilename, JSON.stringify(myData, null, 4), function(err) {
if(err) {
console.log(err);
} else {
console.log("JSON saved to ");
}
});
[http://stackoverflow.com/questions/5670752/write-pretty-json-to-file-using-node-js]
Code.ljn:
//Write text to file line by line
var
moFs = require('fs'),
oWs = moFs.createWriteStream('file.json');
oWs.write('text1\n');
oWs.write('text2\n');
oWs.end();
[hmnSgm.2017-06-03]
Name::
* cpt.Ljn-HML-manipulation,
* cpt.Ljn-HML-processing,
* cpt.Ljn-HTML-manipulation,
* cpt.Ljn-HTML-processing,
* cpt.Ljn-code.processing.HTML,
AddressWpg::
* https://github.com/Marak/html: jstohtml,
Specific::
* JSON-to-hml,
* Markdown-to-hml,
AddressWpg::
* https://github.com/frozzare/json-to-html,
Name::
* cpt.Ljn-markdown-to-hml,
AddressWpg::
* https://github.com/vanetix/artificer,
Description::
Non-blocking I/O - every I/O call must take a callback, whether it is to retrieve information from disk, network or another process.
...
The premise of Node is that I/O is the main bottleneck of many (if not most) tasks.
A single I/O operation can take millions of CPU cycles, and in traditional, non-event-loop-based frameworks the execution is blocked for that time.
In Node, I/O operations such as reading a file are performed asynchronously.
[http://book.mixu.net/node/single.html]
Description::
The JSON format is natively supported by Node.js.
Nothing needs to be added and no module inserted using require.
Converting JSON to object and object to JSON can be done using the JSON object and its parse and stringify methods.
Following code describes how to generate a string containing the JSON content for a javascript object.
var contact = {
id: 1,
lastName: "last name",
firstName: "first name"
};
var text = JSON.stringify(contact);
// contains {"id":1,"lastName":"last name","firstName":"first name"}
Following code describes how to get javascript object from a string containing the JSON content.
var text = "{\"id\":1,\"lastName\":\"last name\","
+"\"firstName\":\"first name\"}";
var contact = JSON.parse(text);
[http://templth.wordpress.com/2011/06/07/manipulating-json-and-xml-with-node-js/]
Description::
Node's goal is to provide an easy way to build scalable network programs
[http://nodejs.org/about/]
===
Built-in support for the most important protocols (HTTP, DNS, TLS)
[http://book.mixu.net/node/single.html]
Name::
* cpt.Ljn-networking,
* cpt.Ljn-processing.NETWORKING,
Module:
* dgram: receive and send UDP packets.
* dns: asynchronous DNS resolution.
* http: create an HTTP server or client.
* https: implements http over TLS/SSL.
* net: create a TCP server client
* tls (ssl): uses OpenSSL to provide Transport Layer Security and/or Secure Socket Layer: encrypted stream communication.
Module:
* https://www.npmjs.org/package/grunt-ssh,
* https://www.npmjs.org/package/sftp-upload,
API:
* child-process-module,
* process-object link,
AddressWpg::
* https://medium.com/@leo/getting-started-with-javascript-robotics-5c54e716562c,
Name::
* cpt.Ljn-security-algorithm,
Module:
* https://www.npmjs.org/package/hashids: A small Node.js class to generate YouTube-like hashes from one or many numbers.
Use hashids when you do not want to expose your database ids to the user.
Description::
Stream everything; never force the buffering of data.
[http://book.mixu.net/node/single.html]
AddressWpg::
* http://www.sitepoint.com/introduction-to-streams/
Code.ljn:
Let's consider the following example:
var http = require('http')
, fs = require('fs')
;
var server = http.createServer(function (req, res) {
fs.readFile(__dirname + '/data.txt', function (err, data) {
res.end(data);
});
});
server.listen(8000);
This code works perfectly.
Nothing is wrong with it, except for the fact that Node.js
buffers the entire contents of data.txt before sending the data back to the client.
With the increase of clients requests your application could start to consume a lot of memory.
In addition clients will need to wait for the entire file to be read by the server application, resulting in increased latency.
Let's have a look at another example:
var http = require('http')
, fs = require('fs')
;
var server = http.createServer(function (req, res) {
var stream = fs.createReadStream(__dirname + '/data.txt');
stream.pipe(res);
});
server.listen(8000);
Here, to overcome the scalability issues we use the streams API.
Using the stream object ensures that data.txt is sent to clients one chunk at a time as they are read from the disk, without server buffering and waiting times on the client.
[http://www.sitepoint.com/introduction-to-streams/]
Description::
What are Streams?
Streams can be defined as a continuous flow of data that can be manipulated asynchronously as data comes in (or out).
In Node.js streams can be readable or writable.
A readable stream is an EventEmitter object that emits data events every time a chunk of data is received.
In our previous example a readable stream has been used to pipe the content of a file down to a HTTP client.
When the stream reaches the end of our file it emits an end event, indicating that no more data events will occur.
In addition a readable stream can be paused and resumed.
Writable streams, on the other hand, accept streams of data.
This type of stream inherits from the EventEmitter object too, and implements two methods: write() and end().
The first method writes data to a buffer and returns true if the data has been flushed correctly, or false if the buffer is full (in this case the data will be sent out later).The end() method simply indicates that the stream is finished.
[http://www.sitepoint.com/introduction-to-streams/]
Name::
* cpt.Ljn-YAML-manipulation,
* cpt.Ljn-YAML-processing,
Module:
* https://www.npmjs.org/package/js-yaml,
Code.ljn:
* http://nodeexamples.com/2012/09/15/parsing-yaml-files-in-node-js-using-the-js-yaml-module/
Name::
* cpt.Ljn-XML-manipulation,
* cpt.Ljn-XML-processing,
AddressWpg::
* http://www.rackspace.com/blog/node-elementtree-node-js-library-to-build-and-parse-xml-documents/
* elementtree-module,
Generic::
* Ljs-library,
Name::
* cpt.Ljn-lbr,
* cpt.Ljn-library,
* cpt.Ljn-lbr,
* cpt.Ljn-library,
Generic::
* Ljs-program,
Name::
* cpt.Ljn-apn,
* cpt.Ljn-app,
* cpt.Ljn-application,
* cpt.Ljn-code.application,
* cpt.Ljn-pgm, {2016.06.21}
* cpt.Ljn-program,
* cpt.Ljn-app,
* cpt.Ljn-pgm, {2016.06.21}
* cpt.Ljn-pgm,
* cpt.Node.js-application,
* cpt.Node.js-program,
* cpt.Nodejs-application,
* cpt.Nodejs-program,
* cpt.PgmNodejs,
Description::
Create a new directory and run the following commands.
npm install app
:
downloads the-app
npm install
:
installs the-dependencies on 'package.json'
Description::
$ node app
or
you can make your file directly executable by changing permisions:
$ chmod o+x app.js
and insert the following as the first line of the file:
#!/usr/bin/env node
You can then execute the file directly:
$ ./app.js
[http://nodetuts.com/pdf/handson-nodejs-sample.pdf]
Name::
* cpt.Ljn-pgm'executing,
* cpt.Ljn-pgm-executing,
* cpt.Node-app-running,
Command-line-arguments:
(link)
Description::
Node.js includes a full-featured out-of-process debugging utility accessible via a simple TCP-based protocol and built-in debugging client.
To use it, start Node.js with the debug argument followed by the path to the script to debug; a prompt will be displayed indicating successful launch of the debugger:
$ node debug myscript.js
< debugger listening on port 5858
connecting... ok
break in /home/indutny/Code/git/indutny/myscript.js:1
1 x = 5;
2 setTimeout(() => {
3 debugger;
debug>
Node.js's debugger client is not a full-featured debugger, but simple step and inspection are possible.
[https://nodejs.org/docs/v6.3.1/api/debugger.html#debugger_debugger]
Name::
* cpt.Ljn-debugging,
* cpt.Ljn-dbg,
AddressWpg::
* https://blog.risingstack.com/node-hero-node-js-debugging-tutorial/
Name::
* cpt.Ljn-debugger,
* cpt.Ljn-debugger-sentence,
* cpt.Ljn-debugger-statement,
AddressWpg::
* https://blog.risingstack.com/node-hero-node-js-debugging-tutorial/,
Description::
At the most minimal definition, a dependency is just that - a package of code your application depends on.
Without this code, your application will not work correctly, and perhaps not even build.
[https://snyk.io/blog/whats-an-npm-dependency/]
===
If the-program has a-package.json-file, the-command npm install
, installs the-dependencies of this program.
Name::
* cpt.Ljn-dependency,
* cpt.Ljn-dependencies,
AddressWpg::
* https://snyk.io/blog/whats-an-npm-dependency/
package.json'dependencies:
(link)
Description::
Node.js is a promising technology and an excellent choice for a high load application.
It has been proven by corporations, like Microsoft, eBay, and Yahoo.
If you're unsure about hosting your website/application, you can always use a cheap VPS solution or various cloud-based services, such as Microsoft Azure and Amazon EC2.
Both of these services provide scalable environments at a reasonable price.
[http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/]
Name::
* cpt.Ljn-pgm'deployment,
* cpt.Ljn-hosting-application,
Resource:
* https://blog.risingstack.com/node-hero-deploy-node-js-heroku-docker/,
* https://blog.risingstack.com/moving-node-js-from-paas-to-kubernetes-tutorial/,
Specific::
* AppFog,
* Coudnode,
Specific::
Here are some provider suggestions for Node.js hosting:
bejes.us
Cloud Foundry
Cloudnode
DotCloud
Duostack
Node.js works on a v8 environment – it is a virtual machine or a javascript engine that runs the javascript code, so for hosting you can't use the ordinary web hosts.
You will need the ones that have the v8 environment.
[http://www.hongkiat.com/blog/node-js-server-side-javascript/]
Name::
* cpt.Ljn-apn.specific,
* cpt.Ljn-pgm.specific,
* cpt.Ljn-pgm.specific,
The Hello World App:
Create a-directory.
Create on a-text-editor the-file, called filHello.js
for example, and type the-code:
console.log('Hello World!');
Close the-file and type on the-same directory the-command:
node filHello.js
You should see 'Hello World!' displayed in the console.
The Hello World Web-Server:
An example of a web server written with Node.js which responds with 'Hello World':
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
To run the server, put the code into a file called example.js and execute it with Node.js:
$ node example.js
Server running at http://127.0.0.1:3000/
All of the examples in the documentation can be run similarly.
[https://nodejs.org/docs/v6.3.1/api/synopsis.html#synopsis_example]
Description::
Npm-packages like commander and yargs help us to manage the-input and option arguments of these programs.
Name::
* cpt.Ljn-CLI-app,
* cpt.Ljn-CLI-program,
* cpt.Ljn-pgm.CLI,
AddressWpg::
* https://www.npmjs.com/package/commander the complete solution for node.js command-line programs,
* https://www.npmjs.com/package/yargs yargs the modern, pirate-themed, successor to optimist,
* https://medium.freecodecamp.com/writing-command-line-applications-in-nodejs,
Description::
There are few options for writing GUI apps in Node:
* AppJS - the oldest one, not actively developed, recommends NW.js or Electron
* NW.js - previously known as node-webkit, sponsored by Intel and Gnor Tech, used in Intel XDK, WhatsApp for Desktop and many others apps
* Brackets Shell by Adobe - a CEF-based application shell for the Brackets editor, not really meant for use in anything other than Brackets, but people use it for other projects and there are some tutorials online
* Electron by GitHub - previously known as the Atom Shell originally created for the Atom editor, used by Atom, Slack, Visual Studio Code, Ionic Lab, Light Table, WordPress.com, Google Play Music Desktop Player, Yeoman and many other apps - (the 1.0 just released on May 11, 2016)
[http://softwarerecs.stackexchange.com/a/32220]
Name::
* cpt.Ljn-desktop-app,
* cpt.Ljn-desktop-program,
* cpt.Ljn-GUI-app,
* cpt.Ljn-pgm.desktop,
AddressWpg::
* http://code.tutsplus.com/tutorials/ introduction-to-html5-desktop-apps-with-node-webkit--net-36296,
blogsiple:
* https://github.com/bergie/blogsiple,
Specific::
* http://stackoverflow.com/questions/3684743/cms-based-on-nodejs,
===
* https://github.com/joyent/node/wiki/modules#wiki-content-management,
* https://github.com/punkave/apostrophe, mogoDB.
* https://github.com/dpirek/nodejs-mvc-cms,
Cliste:
* https://github.com/bmarti44/Cliste,
- mogoDB,
InvaNode:
* https://github.com/i-vetrov/InvaNode-mongo,
InvaNode is a simple CMS.
It has base functionality for simple web-site with manageable content and template engine.
It is light and easy customizable.
- mogoDB.
Name::
* cpt'ljn'editor-program,
* cpt'ljn'editor-written-in-Node.js,
AddressWpg::
* https://www.npmjs.org/package/brackets,
* https://www.npmjs.org/package/scripted,
* https://github.com/soliton4/nodeMirror,
Description::
Command line app for searching in HTML files for elements that match a CSS selector
[https://npmjs.org/package/elfinder]
Name::
* cpt.Ljn-pgm.ftp,
* cpt.Ljn-ftp-application,
node-ftp:
node-ftp is an FTP client module for node.js that provides an asynchronous interface for communicating with an FTP server.
[https://github.com/mscdex/node-ftp]
Description::
An example of a popular Rails-like framework is Geddy
[http://dailyjs.com/2010/11/01/node-tutorial/]
===
A simple, structured web framework for Node
[http://geddyjs.org/]
===
Geddy is built on the same MVC principles that many popular frameworks are based on.
Every Geddy app has its models, controllers, and views as well as config files and routes.
[http://geddyjs.org/documentation]
AddressWpg::
* https://tennu.github.io/:
Simple, Robust, Reusable IRC Bots
Name::
* cpt.Ljn-parser-written-in-Node.js,
AddressWpg::
* https://github.com/joyent/node/wiki/Modules#parsers,
Description::
Slim Node is a blog engine that makes use of Markdown flat files as a blogging engine, making it easy to update and edit, without having to worry about having a chunky CMS like wordpress or Drupal to manage your content.
It is quick and light and the entire application logic (not including node dependencies) is only 56kb in size.
You can use Git to push updates to the articles folder, making it easy to update.
[http://localhost:8080/page/about]
Description::
Wheat is a blogging engine that reads a git repo full of markdown articles and presents them as a website.
[https://github.com/creationix/wheat]
===
Tim Caswell's "Wheat" blog engine
[http://n8.io/starting-over/]
Description:
A-Node.js-npm-package (default) is a-library or a-program with a-package.json-file.
[HmnSgm.2016-08-08]
===
A-Node.js-package is a-library or a-program with a-package.json-file.
[HmnSgm.2016-08-01]
Name::
* cpt.Ljn-npm'package,
* cpt.Ljn-package,
* cpt.Ljn-package,
* cpt.Ljn-pkg,
* cpt.Ljn-pkg,
* cpt.Node.js-package,
* cpt.Nodejs-package,
* cpt.Npm'package,
* cpt.Npm-package,
* cpt.Npmpkg,
Description::
What is a package?
A package is:
a) a folder containing a program described by a package.json file
b) a gzipped tarball containing (a)
c) a url that resolves to (b)
d) a <name>@<version> that is published on the registry with (c)
e) a <name>@<tag> that points to (d)
f) a <name> that has a "latest" tag satisfying (e)
g) a git url that, when cloned, results in (a).
Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b).
Git urls can be of the form:
git://github.com/user/project.git#commit-ish
git+ssh://user@hostname:project.git#commit-ish
git+http://user@hostname/project/blah.git#commit-ish
git+https://user@hostname/project/blah.git#commit-ish
The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout.
The default is master.
What is a module?
A module is anything that can be loaded with require() in a Node.js program.
The following things are all examples of things that can be loaded as modules:
- A folder with a package.json file containing a main field.
- A folder with an index.js file in it.
- A javascript file.
Most npm packages are modules, because they are libraries that you load with require.
However, there's no requirement that an npm package be a module! Some only contain an executable command-line interface, and don't provide a main field for use in Node programs.
Almost all npm packages (at least, those that are Node programs) contain many modules within them (because every file they load with require() is a module).
In the context of a Node program, the module is also the thing that was loaded from a file.
For example, in the following program:
var req = require('request')
we might say that "The variable req refers to the request module".
[https://www.npmjs.org/doc/faq.html#What-is-a-package]
Generic::
* Ljs-package,
Description::
A package.json file contains an overview of your application.
There are a lot of available fields, but this is pretty much the minimum.
The dependencies section describes the name and version of the modules you'd like to install.
In this case I'll accept any version of Express 3.3.
You can list as many dependencies as you want in this section.
Now instead of installing each dependency separately, we can run a single command and install all of them.
> npm install
When you run this command npm will look in the current folder for a package.json file.
If it finds one, it will install every dependency listed.
[http://blog.modulus.io/absolute-beginners-guide-to-nodejs]
===
This document is all you need to know about what's required in your package.json file.
It must be actual JSON, not just a javascript object literal.
A lot of the behavior described in this document is affected by the config settings described in npm-config(7).
[https://npmjs.org/doc/files/package.json.html]
Name::
* cpt.Ljn-package.json,
* cpt.Ljn-package.json-file,
* cpt.Ljn-pkgjson,
* cpt.Ljn-pkgjsn,
* cpt.Npm'package.json,
* cpt.Npmpkgjsn,
* cpt.Package.json,
* cpt.Package.json-file,
AddressWpg::
* https://www.npmjs.org/doc/files/package.json.html,
* https://docs.npmjs.com/getting-started/using-a-package.json
Name::
* cpt.Npmpkgjsn'entry,
* cpt.Npmpkgjsn'field,
* cpt.Npmpkgjsn'member,
Specific::
=== mandatory:
* name,
* version,
===
* description,
* main,
* author,
* bin,
* bugs,
* config,
* contributors,
* cpu,
* dependencies,
* devDependencies,
* directories,
* engines,
* files,
* homepage,
* keywords,
* license,
* os,
* peerDependencies,
* preferGlobal,
* private,
* publishConfig,
* repository,
* scripts,
Description::
"name" : "pkgname",
===
The most important things in your package.json are the name and version fields. Those are actually required, and your package won't install without them. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version.
The name is what your thing is called.
Some rules:
- The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
- The name can't start with a dot or an underscore.
- New packages must not have uppercase letters in the name.
- The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, - the name can't contain any non-URL-safe characters.
Some tips:
- Don't use the same name as a core Node module.
- Don't put "js" or "node" in the name. It's assumed that it's js, since you're writing a package.json file, and you can specify the engine using the "engines" field. (See below.)
- The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive.
- You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. https://www.npmjs.com/
A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See npm-scope for more detail.
[https://docs.npmjs.com/files/package.json#name]
Description::
"version" : "0.10.2", //major.minor.bug
===
The most important things in your package.json are the name and version fields.
Those are actually required, and your package won't install without them.
The name and version together form an identifier that is assumed to be completely unique.
Changes to the package should come along with changes to the version.
Version must be parseable by node-semver, which is bundled with npm as a dependency. (npm install semver
to use it yourself.)
More on version numbers and ranges at semver(7).
[https://docs.npmjs.com/files/package.json#version]
Description::
"bin" : "./path/to/program",
===
A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.)
To use this, supply a bin field in your package.json which is a map of command name to local file name. On install, npm will symlink that file into prefix/bin for global installs, or ./node_modules/.bin/ for local installs.
For example, myapp could have this:
{ "bin" : { "myapp" : "./cli.js" } }
So, when you install myapp, it'll create a symlink from the cli.js script to /usr/local/bin/myapp.
If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. For example:
{ "name": "my-program"
, "version": "1.2.5"
, "bin": "./path/to/program" }
would be the same as this:
{ "name": "my-program"
, "version": "1.2.5"
, "bin" : { "my-program" : "./path/to/program" } }
[https://docs.npmjs.com/files/package.json#bin]
Description::
"bugs" : { "url" : "https://github.com/user/my_package/issues" },
===
The url to your project's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.
It should look like this:
{ "url" : "https://github.com/owner/project/issues"
, "email" : "project@hostname.com"
}
You can specify either one or both values. If you want to provide only a url, you can specify the value for "bugs" as a simple string instead of an object.
If a url is provided, it will be used by the npm bugs command.
[https://docs.npmjs.com/files/package.json#bugs]
Description::
"config" : { "port" : "8080" },
===
A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. For instance, if a package had the following:
{ "name" : "foo"
, "config" : { "port" : "8080" } }
and then had a "start" command that then referenced the npm_package_config_port environment variable, then the user could override that by doing npm config set foo:port 8001.
See npm-config and npm-scripts for more on package configs.
[https://docs.npmjs.com/files/package.json#config]
Description::
"contributors" : [{person1}, {person2}],
===
The "author" is one person. "contributors" is an array of people.
[https://docs.npmjs.com/files/package.json#people-fields-author-contributors]
===
DEFAULT VALUES
"contributors": [...]
If there is an AUTHORS file in the root of your package, npm will treat each line as a Name <email> (url) format, where email and url are optional. Lines which start with a # or are blank, will be ignored.
[https://docs.npmjs.com/files/package.json#default-values]
Description::
"cpu" : [ "x64", "ia32" ],
===
If your code only runs on certain cpu architectures, you can specify which ones.
"cpu" : [ "x64", "ia32" ]
Like the os option, you can also blacklist architectures:
"cpu" : [ "!arm", "!mips" ]
The host architecture is determined by process.arch
[https://docs.npmjs.com/files/package.json#cpu]
Description::
"dependencies" : {
"hoek": "0.7.x",
"dyl" : "file:../dyl",
"til" : "~1.2",
"lat" : "latest"
},
===
Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.
Please do not put test harnesses or transpilers in your dependencies object. See devDependencies, below.
[https://docs.npmjs.com/files/package.json#dependencies]
Description::
"description" : "A packaged foo fooer for fooing foos",
===
Put a description in it.
It's a string.
This helps people discover your package, as it's listed in npm search
.
[https://docs.npmjs.com/files/package.json#description]as it's listed in npm search.
Description::
"devDependencies" : {
"lab" : "0.0.x",
"complexity-report" : "0.x.x"
},
===
If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.
In this case, it's best to map these additional items in a devDependencies object.
These things will be installed when doing npm link or npm install from the root of a package, and can be managed like any other npm configuration param. See npm-config for more on the topic.
For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the prepublish script to do this, and make the required package a devDependency.
For example:
{ "name": "ethopia-waza",
"description": "a delightfully fruity coffee varietal",
"version": "1.2.3",
"devDependencies": {
"coffee-script": "~1.6.3"
},
"scripts": {
"prepublish": "coffee -o lib/ -c src/waza.coffee"
},
"main": "lib/waza.js"
}
The prepublish script will be run before publishing, so that users can consume the functionality without requiring them to compile it themselves. In dev mode (ie, locally running npm install), it'll run this script as well, so that you can test it easily.
[https://docs.npmjs.com/files/package.json#devdependencies]
Description::
"directories" : {
"lib" : "local/lib",
"bin" : "local/binaries",
"man" : "local/man",
"doc" : "local/docs"
},
===
The CommonJS Packages spec details a few ways that you can indicate the structure of your package using a directories object. If you look at npm's package.json, you'll see that it has directories for doc, lib, and man.
In the future, this information may be used in other creative ways.
directories.lib
Tell people where the bulk of your library is. Nothing special is done with the lib folder in any way, but it's useful meta info.
directories.bin
If you specify a bin directory in directories.bin, all the files in that folder will be added.
Because of the way the bin directive works, specifying both a bin path and setting directories.bin is an error. If you want to specify individual files, use bin, and for all the files in an existing bin directory, use directories.bin.
directories.man
A folder that is full of man pages. Sugar to generate a "man" array by walking the folder.
directories.doc
Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.
directories.example
Put example scripts in here. Someday, it might be exposed in some clever way.
[https://docs.npmjs.com/files/package.json#directories]
Description::
"engines" : { "node" : ">=0.10.3 <0.12", "npm" : "1.3.5" },
===
You can specify the version of node that your stuff works on:
{ "engines" : { "node" : ">=0.10.3 <0.12" } }
And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do.
If you specify an "engines" field, then npm will require that "node" be somewhere on that list. If "engines" is omitted, then npm will just assume that it works on node.
You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. For example:
{ "engines" : { "npm" : "~1.0.20" } }
Note that, unless the user has set the engine-strict config flag, this field is advisory only.
[https://docs.npmjs.com/files/package.json#engines]
Description::
"files" : [ filName, dirName],
===
The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. (Unless they would be ignored by another rule.)
You can also provide a ".npmignore" file in the root of your package or in subdirectories, which will keep files from being included, even if they would be picked up by the files array. The .npmignore file works just like a .gitignore.
Certain files are always included, regardless of settings:
package.json
README (and its variants)
CHANGELOG (and its variants)
LICENSE / LICENCE
Conversely, some files are always ignored:
.git
CVS
.svn
.hg
.lock-wscript
.wafpickle-N
*.swp
.DS_Store
._*
npm-debug.log
[https://docs.npmjs.com/files/package.json#files]
Description::
"homepage" : "https://my-homepage/",
===
The url to the project homepage.
NOTE: This is not the same as "url". If you put a "url" field, then the registry will think it's a redirection to your package that has been published somewhere else, and spit at you.
Literally. Spit. I'm so not kidding.
[https://docs.npmjs.com/files/package.json#homepage]
Description::
"keywords" : [ "http", "authentication" ],
===
Put keywords in it.
It's an array of strings.
This helps people discover your package as it's listed in npm search.
[https://docs.npmjs.com/files/package.json#keywords]s it's listed in npm search.
Description::
"license" : "MIT",
===
You should specify a license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.
If you're using a common license such as BSD-2-Clause or MIT, add a current SPDX license identifier for the license you're using, like this:
{ "license" : "BSD-3-Clause" }
You can check the full list of SPDX license IDs. Ideally you should pick one that is OSI approved.
[https://docs.npmjs.com/files/package.json#license]
Description::
"main" : "index",
===
Contains the-entry-module we want the-require()-function to access in the-package.
In contrast, in the-bin-directory we put the-entry-module of a-CLI-package (a-package that can be run as a-CLI-program).
A-package could have both entries.
[HmnSgm.2016.12.02]
===
The main field is a module ID that is the primary entry point to your program.
That is, if your package is named foo, and a user installs it, and then does require("foo"), then your main module's exports object will be returned.
This should be a module ID relative to the root of your package folder.
For most modules, it makes the most sense to have a main script and often not much else.
[https://docs.npmjs.com/files/package.json#main]
Description::
"os" : [ "darwin", "linux" ],
===
You can specify which operating systems your module will run on:
"os" : [ "darwin", "linux" ]
You can also blacklist instead of whitelist operating systems, just prepend the blacklisted os with a '!':
"os" : [ "!win32" ]
The host operating system is determined by process.platform
It is allowed to both blacklist, and whitelist, although there isn't any good reason to do this.
[https://docs.npmjs.com/files/package.json#os]
Description::
"peerDependencies" : { "tea" : "2.x" },
===
In some cases, you want to express the compatibility of your package with a host tool or library, while not necessarily doing a require of this host. This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.
For example:
{
"name": "tea-latte",
"version": "1.3.5",
"peerDependencies": {
"tea": "2.x"
}
}
This ensures your package tea-latte can be installed along with the second major version of the host package tea only. npm install tea-latte could possibly yield the following dependency graph:
├── tea-latte@1.3.5
└── tea@2.2.0
NOTE: npm versions 1 and 2 will automatically install peerDependencies if they are not explicitly depended upon higher in the dependency tree. In the next major version of npm (npm@3), this will no longer be the case. You will receive a warning that the peerDependency is not installed instead. The behavior in npms 1 & 2 was frequently confusing and could easily put you into dependency hell, a situation that npm is designed to avoid as much as possible.
Trying to install another plugin with a conflicting requirement will cause an error. For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions.
Assuming the host complies with semver, only changes in the host package's major version will break your plugin. Thus, if you've worked with every 1.x version of the host package, use "^1.0" or "1.x" to express this. If you depend on features introduced in 1.5.2, use ">= 1.5.2 < 2".
[https://docs.npmjs.com/files/package.json#peerdependencies]
Description::
"preferGlobal" : true,
===
If your package is primarily a command-line application that should be installed globally, then set this value to true to provide a warning if it is installed locally.
It doesn't actually prevent users from installing it locally, but it does help prevent some confusion if it doesn't work as expected.
[https://docs.npmjs.com/files/package.json#preferglobal]
Description::
"private" : true,
===
If you set "private": true in your package.json, then npm will refuse to publish it.
This is a way to prevent accidental publication of private repositories. If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the publishConfig dictionary described below to override the registry config param at publish-time.
[https://docs.npmjs.com/files/package.json#private]
Description::
"publishConfig" : { "registry" : "http://my-internal-registry.local" },
===
This is a set of config values that will be used at publish-time. It's especially handy if you want to set the tag, registry or access, so that you can ensure that a given package is not tagged with "latest", published to the global public registry or that a scoped module is private by default.
Any config values can be overridden, but of course only "tag", "registry" and "access" probably matter for the purposes of publishing.
See npm-config to see the list of config options that can be overridden.
[https://docs.npmjs.com/files/package.json#publishconfig]
Description::
"repository" : {
"type" : "git",
"url" : "git://github.com/hueniverse/hawk"
},
===
Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the npm docs command will be able to find you.
Do it like this:
"repository" :
{ "type" : "git"
, "url" : "https://github.com/npm/npm.git"
}
"repository" :
{ "type" : "svn"
, "url" : "https://v8.googlecode.com/svn/trunk/"
}
The URL should be a publicly available (perhaps read-only) url that can be handed directly to a VCS program without any modification. It should not be a url to an html project page that you put in your browser. It's for computers.
For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same shortcut syntax you use for npm install:
"repository": "npm/npm"
"repository": "gist:11081aaa281"
"repository": "bitbucket:example/repo"
"repository": "gitlab:another/repo"
[https://docs.npmjs.com/files/package.json#repository]
Description::
"scripts": {
"start" : "node app",
"test" : "make test-cov"
},
===
npm start [-- 'args']
Description
This runs an arbitrary command specified in the package's "start" property of its "scripts" object. If no "start" property is specified on the "scripts" object, it will run node server.js
.
[https://docs.npmjs.com/cli/start]
===
You can specify the version of node that your stuff works on:
{ "engines" : { "node" : ">=0.10.3 <0.12" } }
And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do.
If you specify an "engines" field, then npm will require that "node" be somewhere on that list. If "engines" is omitted, then npm will just assume that it works on node.
You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. For example:
{ "engines" : { "npm" : "~1.0.20" } }
Note that, unless the user has set the engine-strict config flag, this field is advisory only.
[https://docs.npmjs.com/files/package.json#scripts]
Example-of-package.json-file:
{
"name" : "pkgname",
"version" : "0.10.2",
"description" : "A packaged foo fooer for fooing foos",
"main" : "index.js",
"author" : "Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)",
"bin" : "./path/to/program",
"bugs" : { "url" : "https://github.com/user/my_package/issues" },
"config" : { "port" : "8080" },
"contributors" : [ {person1}, {person2}],
"cpu" : [ "x64", "ia32" ],
"dependencies" : { "hoek" : "0.7.x", "dyl" : "file:../dyl" },
"devDependencies" : {
"lab" : "0.0.x",
"complexity-report" : "0.x.x"
},
"directories" : {
"lib" : "local/lib",
"bin" : "local/binaries",
"man" : "local/man",
"doc" : "local/docs"
},
"engines" : { "node" : ">=0.10.3 <0.12", "npm" : "1.3.5" },
"files" : [ filName, dirName],
"homepage" : "https://my-homepage/",
"keywords" : [ "http", "authentication" ],
"os" : [ "darwin", "linux" ],
"peerDependencies" : { "tea" : "2.x" },
"preferGlobal" : true,
"private" : true,
"publishConfig" : { "registry" : "http://my-internal-registry.local" },
"repository" : {
"type" : "git",
"url" : "git://github.com/hueniverse/hawk"
},
"scripts" : { "test" : "make test-cov" }
}
Description::
npm install 'package-name'
it will download the-package in node_modules in your current-directory.
npm install -g 'package-name'
it will install it globally.
===
There are two ways to install npm packages: locally or globally. You choose which kind of installation to use based on how you want to use the package.
If you want to use it as a command line tool, something like the grunt CLI, then you want to install it globally. On the other hand, if you want to depend on the package from your own module using something like Node's require, then you want to install locally.
[https://docs.npmjs.com/getting-started/installing-npm-packages-globally]
Name::
* cpt.Ljn-package-installation,
* cpt.Ljn-installing-package,
AddressWpg::
* https://docs.npmjs.com/getting-started/installing-npm-packages-locally,
* https://docs.npmjs.com/getting-started/installing-npm-packages-globally,
Description::
You can remove a package from your node_modules directory using npm uninstall 'package':
npm uninstall lodash
To remove it from the dependencies in package.json, you will need to use the save flag:
npm uninstall --save lodash
Note: if you installed the package as a "devDependency" (i.e. with --save-dev) then --save won't remove it from package.json You have use --save-dev to uninstall it.
[https://docs.npmjs.com/getting-started/uninstalling-local-packages]
===
Global packages can be uninstalled with npm uninstall -g 'package':
npm uninstall -g jshint
[https://docs.npmjs.com/getting-started/uninstalling-global-packages]
Description::
Every so often, you should update the packages you depend on so you can get any changes that have been made to code upstream.
To do this, run npm update
in the same directory as your package.json file.
Test: Run npm outdated
. There should not be any results.
[https://docs.npmjs.com/getting-started/updating-local-packages]
===
Updating global packages
To update global packages, you can use npm install -g <package>
:
npm install -g jshint
To find out which packages need to be updated, you can use npm outdated -g --depth=0
.
To update all global packages, you can use npm update -g
. However, for npm versions less than 2.6.1, this script is recommended to update all outdated global packages.
[https://docs.npmjs.com/getting-started/updating-global-packages]
Description::
The-development of packages usually is done collaboratively in a-github-repository.
Description::
You can publish any directory that has a package.json
file, e.g. a node module.
Creating a user
To publish, you must have a user on the npm registry. If you don't have one, create it with npm adduser
. If you created one on the site, use npm login
to store the credentials on the client.
Test: Use npm config ls
to ensure that the credentials are stored on your client. Check that it has been added to the registry by going to https://npmjs.com/~.
Publishing the package
Use npm publish
to publish the package.
Note that everything in the directory will be included unless it is ignored by a local .gitignore or .npmignore file as described in npm-developers.
Also make sure there isn't already a package with the same name, owned by somebody else.
Test: Go to https://npmjs.com/package/<package>. You should see the information for your new package.
Updating the package
When you make changes, you can update the package using npm version <update_type>
, where update_type is one of the semantic versioning release types, patch, minor, or major. This command will change the version number in package.json. Note that this will also add a tag with this release number to your git repository if you have one.
After updating the version number, you can npm publish
again.
Test: Go to https://npmjs.com/package/<package>. The package number should be updated.
The README displayed on the site will not be updated unless a new version of your package is published, so you would need to run npm version patch
and npm publish
to have a documentation fix displayed on the site.
[https://docs.npmjs.com/getting-started/publishing-npm-packages]
Description::
unpkg is a fast, global content-delivery network for stuff that is published to npm. Use it to quickly and easily load files using a simple URL like:
https://unpkg.com/package@version/file
[https://unpkg.com/]
Name::
* cpt.Npmpkg.specific, cpt.ljnpkg.specific,
Specific::
* private-package,
* privateNo-package,
===
* local-package,
* localNo-package,
Description::
All npm packages have a name. Some package names also have a scope. A scope follows the usual rules for package names (url-safe characters, no leading dots or underscores). When used in package names, preceded by an @-symbol and followed by a slash, e.g.
@somescope/somepackagename
Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package.
Scoped packages are supported by the public npm registry. The npm client is backwards-compatible with un-scoped registries, so it can be used to work with scoped and un-scoped registries at the same time.
[https://docs.npmjs.com/misc/scopec]
Name::
* cpt.Npm'scoped-package,
* cpt.Npmpkg.scoped,
* cpt.Scoped-package,
Description::
AMD Library Compiler
This is a Node.js AMD Library Compiler. It enables you to write code in an the AMD style and compile the modules into a standalone library file with all public modules exposed into the global namespace this is the opposite to application specific AMD module loaders like RequireJS.
When compiling AMD projects using this compileer you get three files:
- Inline minified file using Uglify-js
- Inline source file
- Development file that loads the modules synchronous (debug)
[https://npmjs.org/package/amdlc]
Name::
* cpt.Npm'amdlc-package,
* cpt.Npmpkg.amdlc,
* cpt.Amdlc,
Description:
browser-side require() the node way require('modules')
in the browser
Use a node-style require() to organize your browser code and load modules installed by npm.
browserify will recursively analyze all the require() calls in your app in order to build a bundle you can serve up to the browser in a single script
tag.
[https://www.npmjs.com/package/browserify]
Name::
* cpt.Browserify,
* cpt.Ljn-browserify-module,
* cpt.Ljn-m.browserify,
AddressWpg::
* http://browserify.org/
* https://github.com/substack/browserify-handbook,
Description::
Introduction to browserify
There's all this wonderful code on npm, the node.js package manager.
What if we could use that code in the browser?
Hey, we can.
Use browserify.
With browserify, we can use some core node modules and many of the thousands of modules on npm in our browser-side code.
We can also write our browser-side javascript in the node.js style by using require.
Install browserify:
npm install -g browserify
We use the -g option to install browserify globally on your machine, allowing you to use it on the command line.
Brief example:
// require the core node events module
var EventEmitter = require('events').EventEmitter;
//create a new event emitter
var emitter = new EventEmitter;
// set up a listener for the event
emitter.on('pizza', function(message){
console.log(message);
});
// emit an event
emitter.emit('pizza', 'pizza is extremely yummy');
Put the above code in a file named index.js.
Now, to be able to run this code in the browser, enter this command in the terminal:
browserify index.js > bundle.js
The bundle.js file now has your event emitter code along with any dependencies on core node modules and shims to make them work in the browser.
You can include bundle.js in your html now like any other javascript file.
Example:
<!DOCTYPE html>
<html>
<head>
<title>node / browserify example</title>
</head>
<body>
<script src="./bundle.js"></script>
</body>
</html>
That's it! Now you can use node modules and require in the browser!
Live reload development environment
If you're in the middle of writing code, you'll find running browserify in the terminal to regenerate bundle.js, then refreshing the browser to be time-consuming and annoying.
Enter beefy
!
beefy is a command-line tool for automatically generating and serving your browserify bundles as you develop.
Each time you save your javascript file beefy will regenerate bundle.js and refresh the browser automatically.
Install beefy:
npm install -g beefy
Now, run this:
beefy index.js:bundle.js --live
The --live option enables the live reload functionality of beefy.
This will by default serve your index.html file at http://localhost:9966.
Open Chrome, enter that url, then open the javascript console by using the keyboard shortcut command+option+j.
You'll see pizza is extremely yummy in the javascript console!
[http://superbigtree.tumblr.com/post/54873453939/introduction-to-browserify]
Description::
An AST-based pattern checker for JavaScript.
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:
* ESLint uses Espree for JavaScript parsing.
* ESLint uses an AST to evaluate patterns in code.
* ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.
[https://npmjs.org/package/eslint]
Name::
* cpt.Npmpkg.eslint,
* cpt.Npm'eslint-package,
* cpt.Eslint,
* cpt.ESLint,
Generic::
* Ljn-code-analysis-tool,
Description::
Web Applications
Express is a minimal and flexible node.js web application framework, providing a robust set of features for building single and multi-page, and hybrid web applications.
[http://expressjs.com/]
===
A simpler, Sinatra style framework is Express which has been around since June 2009, and is still regularly updated.
[http://dailyjs.com/2010/11/01/node-tutorial/]
Name::
* cpt.Express-library,
* cpt.Express-nodejs-framework,
* cpt.Expressjs,
* cpt.Ljn-express,
* cpt.Ljn-express,
* cpt.Ljn-lbr.express,
* cpt.Ljn-m.express,
Code.ljn:
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('hello world');
});
app.listen(3333);
// ---
// http://localhost:3333
[http://expressjs.com/guide.html]
Description::
Doing Something Useful - Express
Express is a framework that makes creating most normal websites very simple.
The first thing you have to do it install it.
Along with the node command you also have access to a command called "npm".
This tool gives you access to an enormous collection of modules created by the community, and one of them is Express.
$ cd /my/app/location
$ npm install express
When you install a module, it will put it in a node_modules folder inside your application directory.
You can now require it like any built-in module.
Let's create a basic static file server using Express.
my_static_file_server.js
var express = require('express'),
app = express();
app.use(express.static(__dirname + '/public'));
app.listen(8080);
$ node my_static_file_server.js
You now have a pretty capable static file server.
Anything you put in the /public folder can now be requested by your browser and displayed.
HTML, images, almost anything.
So for example, if you put an image called "my_image.png" inside the public folder, you can access it using your browser by going to http://localhost:8080/my_image.png.
Of course Express has many many more features, but you can look those up as you continue developing.
[http://blog.modulus.io/absolute-beginners-guide-to-nodejs]
AddressWpg::
* http://expressjs.com/api.html,
* https://github.com/visionmedia/express/tree/master/examples,
Description::
Glob
Match files using the patterns the shell uses, like stars and stuff.
This is a glob implementation in javascript.
It uses the minimatch library to do its matching.
Attention: node-glob users!
The API has changed dramatically between 2.x and 3.x.
This library is now 100% javascript, and the integer flags have been replaced with an options object.
Also, there's an event emitter class, proper tests, and all the other things you've come to expect from node modules.
And best of all, no compilation!
[https://npmjs.org/package/glob]
Description::
Jade is a high performance template engine heavily influenced by Haml and implemented with javascript for node.
[https://www.npmjs.org/package/jade]
Name::
* cpt.Npmpkg.jade,
* cpt.Npm'jade-package,
* cpt.Jade,
AddressWpg::
* http://jade-lang.com/
Description::
javascript build tool, similar to Make or Rake.
Built to work with Node.js.
Jake is a simple javascript build program with capabilities similar to the
regular make or rake command.
Jake has the following features:
* Jakefiles are in standard javascript syntax
* Tasks with prerequisites
* Namespaces for tasks
* Async task execution
[https://github.com/mde/jake]
Name::
* cpt.Ljn-jake,
* cpt.Npmpkg.jake,
* cpt.Npm'jake-package,
* cpt.Jake,
Generic-chain::
* build-tool,
* ljs-based-task-runner,
AddressWpg::
* https://github.com/mde/jake,
* http://howtonode.org/intro-to-jake,
Description::
Use namespace to create a namespace of tasks to perform.
Call it with two arguments:
namespace(name, namespaceTasks);
Where is name is the name of the namespace, and namespaceTasks is a function with calls inside it to task or desc definining all the tasks for that namespace.
Here's an example:
desc('This is the default task.');
task('default', function () {
console.log('This is the default task.');
});
namespace('foo', function () {
desc('This the foo:bar task');
task('bar', function () {
console.log('doing foo:bar task');
});
desc('This the foo:baz task');
task('baz', ['default', 'foo:bar'], function () {
console.log('doing foo:baz task');
});
});
In this example, the foo:baz task depends on the the default and foo:bar tasks.
[https://github.com/mde/jake]
Description::
In your Jakefile, call task to define tasks.
Call it with three arguments (and one more optional argument):
task(name, dependencies, handler, [async]);
Where name is the string name of the task, dependencies is an array of the dependencies, and handler is a function to run for the task.
[http://howtonode.org/intro-to-jake]
Name::
* cpt.Ljn-jake'directory-task,
Description::
Create a directory-task by calling directory.
Directory-tasks create a directory for use with for file-tasks.
Jake checks for the existence of the directory, and only creates it if needed.
desc('This creates the bar directory for use with the foo-minified.js file-task.');
directory('bar');
This task will create the directory when used as a prerequisite for a file-task, or when run from the command-line.
[https://github.com/mde/jake]
Name::
* cpt.Ljn-jake'file-task,
Description::
File-tasks
Create a file-task by calling file.
File-tasks create a file from one or more other files.
With a file-task, Jake checks both that the file exists, and also that it is not older than the files specified by any prerequisite tasks.
File-tasks are particularly useful for compiling something from a tree of source files.
desc('This builds a minified JS file for production.');
file('foo-minified.js', ['bar', 'foo-bar.js', 'foo-baz.js'], function () {
// Code to concat and minify goes here
});
[https://github.com/mde/jake]
Basic usage:
jake [options ...] [env variables ...] target
Options
-V/v
--version Display the Jake version.
-h
--help Display help message.
-f *FILE*
--jakefile *FILE* Use FILE as the Jakefile.
-C *DIRECTORY*
--directory *DIRECTORY* Change to DIRECTORY before running tasks.
-q
--quiet Do not log messages to standard output.
-J *JAKELIBDIR*
--jakelibdir *JAKELIBDIR* Auto-import any .jake files in JAKELIBDIR.
(default is 'jakelib')
-B
--always-make Unconditionally make all targets.
-t
--trace Enable full backtrace.
-T/ls
--tasks Display the tasks (matching optional PATTERN)
with descriptions, then exit.
[https://github.com/mde/jake#basic-usage]
Name::
* cpt.Ljs-dom,
* cpt.Npmpkg.jsdom,
* cpt.Npm'jsdom-package,
AddressWpg::
* Transforming HTML with Node.js and jQuery: http://www.2ality.com/2012/02/jsdom.html,
Description::
JSHint, A Static Code Analysis Tool for javascript
JSHint is a community-driven tool to detect errors and potential problems in javascript code and to enforce your team's coding conventions.
We made JSHint very flexible so you can easily adjust it to your particular coding guidelines and the environment you expect your code to execute in.
Our goal is to help javascript developers write complex programs without worrying about typos and language gotchas.
We believe that static code analysis programs—as well as other code quality tools—are important and beneficial to the javascript community and, thus, should not alienate their users.
For general usage and hacking information, visit our website: http://jshint.com/.
[https://npmjs.org/package/jshint]
Name::
* cpt.Npmpkg.jshint,
* cpt.Npm'jshint-package,
* cpt.Jshint,
* cpt.JSHint,
Generic::
* Ljn-code-analysis-tool,
Description::
The JavaScript Code Quality Tool
node-jslint
Easily use JSLint from the command line.
jslint bin/jslint.js
[https://npmjs.org/package/jshint]
===
Resource: https://www.npmjs.com/package/jslint/tutorial,
Name::
* cpt.Npmpkg.jslint,
* cpt.Npm'jslint-package,
* cpt.Jslint,
* cpt.JSLint,
Generic::
* Ljn-code-analysis-tool,
Description::
The dynamic stylesheet language.
http://lesscss.org
about
This is the javascript, and now official, stable version of LESS.
For more information on the language and usage visit lesscss.org.
More information also available in our wiki
[https://npmjs.org/package/less]
Description::
Moment.js2.6.0
A javascript date library for parsing, validating, manipulating, and formatting dates.
[http://momentjs.com/]
Name::
* cpt.Npmpkg.moment,
* cpt.Npm'moment-package,
* cpt.Momentjs,
Description::
moxie-zip
This is another zip library for node js.
We decided to write our own since we had issues with the current once that exists.
It's a very simple library:
var ZipWriter = require("moxie-zip").ZipWriter;
var zip = new ZipWriter();
zip.addFile("myfile.txt", "./myfile.txt");
zip.addData("myfile.txt", "Hello world!");
zip.addDir("mydir");
zip.toBuffer(function(buf) {
});
zip.saveAs("my.zip", function() {
console.log("zip written.");
});
[https://npmjs.org/package/moxie-zip]
PDFKit
A PDF generation library for Node.js.
Description
PDFKit is a PDF document generation library for Node that makes creating complex, multi-page, printable documents easy.
It is written in pure CoffeeScript, but you can choose to use the API in plain 'ol javascript if you like.
The API embraces chainability, and includes both low level functions as well as abstractions for higher level functionality.
The PDFKit API is designed to be simple, so generating complex documents is often as simple as a few function calls.
Check out some of the documentation and examples to see for yourself!
[https://github.com/devongovett/pdfkit]
Name::
* cpt.Npmpkg.pdfkit,
* cpt.Npm'pdfkit-package,
AddressWpg::
* http://pdfkit.org/,
* https://www.npmjs.com/package/pdfkit,
UglifyJS 2
UglifyJS is a javascript parser, minifier, compressor or beautifier toolkit.
This page documents the command line utility.
For API and internals documentation see my website.
There's also an in-browser online demo (for Firefox, Chrome and probably Safari).
[https://npmjs.org/package/uglify-js]
Name::
* cpt.Npmpkg.uglify-js,
* cpt.Npm'uglify-js-package,
* cpt.Uglify-js-package,
Description::
Stupid simple lib for massively parallel programming with JavaScript.
Allows you to spawn thousands of parallel tasks on the GPU with the simplest, dumbest API possible. It works on the browser (with browserify) and on Node.js. It is ES5-compatible and doesn't require any WebGL extension.
Install
npm install webmonkeys
[https://www.npmjs.com/package/webmonkeys]
Name::
* cpt.Npmpkg.webmonkeys,
* cpt.Npm'webmonkeys-package,
* cpt.Webmonkeys,
Description::
webpack is a module bundler.
webpack takes modules with dependencies and generates static assets representing those modules.
[http://webpack.github.io/docs/what-is-webpack.html]
Name::
* cpt.Npmpkg.webpack,
* cpt.Npm'webpack-package,
* cpt.Webpack,
Name::
* cpt.Ljn-human,
* cpt.Ljn-human,
* cpt.Ljn-hmn,
Specific::
* Dahl.Ryan,
* Caswell.Tim,
Description::
It was 3 p.m. on November 8th, 2009.
In a room filled with people at JSConf Europe, Ryan Dahl showed off his pet project for the first time to a sizable audience.
Node.js, he called it.
[http://cloud9ide.posterous.com/our-commitment-to-the-nodejs-community]
Name::
* cpt.Dahl.Ryan,
* cpt.Ljn-hmn.Dahl.Ryan,
* cpt.Ryan-Dahl,
Description::
Tim Caswell, a prominent Node.js community member, well known for his howtonode.org blog,
[http://cloud9ide.posterous.com/our-commitment-to-the-nodejs-community]
===
* https://github.com/creationix,
* http://creationix.com/
Name::
* cpt.Caswell.Time,
* cpt.Ljn-hmn.Caswell.Tim,
* cpt.Tim-Caswell,
Name::
* cpt.Ljn-organization,
* cpt.Ljn-ogn,
Specific::
* Joyent,
* Node.js-Foundation,
Description::
Joyent is the corporate steward of Node.js, the world's best runtime for today's data-intensive, real-time applications.
Joyent offers exclusive debugging and performance analysis tools for Node.js applications.
[https://www.joyent.com/technology/nodejs]
Name::
* cpt.Ljn-ogn.Joyent,
* cpt.Ljn-Joyent,
* cpt.Joyent,
Description::
The Node.js Foundation's mission is to enable widespread adoption and help accelerate development of Node.js and other related modules through an open governance model that encourages participation, technical contribution, and a framework for long term stewardship by an ecosystem invested in Node.js' success.
[https://nodejs.org/en/foundation/]
Name::
* cpt.Ljn-ogn.Node.js-Foundation,
* cpt.Ljn-Node.js-Foundation,
* cpt.Node.js-Foundation,
Description::
Node.js is different from client-side Javascript in that it removes certain things, like DOM manipulation, and adds support for evented I/O, processes, streams, HTTP, SSL, DNS, string and buffer processing and C/C++ addons.
[http://book.mixu.net/node/single.html]
Name::
* cpt.Ljn-relation-to-ljb,
* cpt.Node.js-relation-to-browser-javascript,
Description::
Node.js uses an event-based server execution procedure rather than the multithreaded execution in PHP.
[http://www.hongkiat.com/blog/node-js-server-side-javascript/]
Name::
* cpt.Ljn-relation-to-PHP,
* cpt.PHP-relation-to-nodejs,
Name::
* cpt.Ljn-resource,
* cpt.Ljn-resource,
* cpt.Ljn-rsc,
AddressWpg::
* http://nodejs.org/
* docs.all: https://nodejs.org/docs/
* docs.latest: http://nodejs.org/docs/latest/api/index.html,
* https://github.com/joyent/node,
* http://nodemanual.org/latest/
* http://nodebits.org/
* http://howtonode.org/
* http://www.nodebeginner.org/
* http://cloud9ide.posterous.com/our-commitment-to-the-nodejs-community?..)
* http://docs.nodejitsu.com/
* http://nodester.com/
* https://github.com/joyent/node/wiki/
* https://github.com/joyent/node/wiki/Node-Hosting,
=== mail:
* http://groups.google.com/group/nodejs
* https://groups.google.com/group/nodejs?pli=1,
* Send email to this group: nodejs@googlegroups.com
=== IRC:
* http://webchat.freenode.net/?channels=node.js,
* #node.js room on irc.freenode.net
=== TUTORIAL
* http://blog.modulus.io/absolute-beginners-guide-to-nodejs,
* http://www.nodebeginner.org/
* http://debuggable.com/posts/understanding-node-js:4bd98440-45e4-4a9a-8ef7-0f7ecbdd56cb,
Program:
* http://stackoverflow.com/questions/3684743/cms-based-on-nodejs,
=== app creation ===
* https://github.com/rogerwang/node-webkit,
* http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/
* http://nodetuts.com/
* http://readwrite.com/2011/04/02/6-free-e-books-on-nodejs,
free: Mixu's Node Book:
* http://book.mixu.net/node/single.html,
free: Mastering-Node:
* http://visionmedia.github.com/masteringnode/book.html,
In Mastering Node we will discover how to write high concurrency web servers, utilizing the CommonJS module system, node's core libraries, third party modules, high level web development and more.
Professional Node.js: Building Javascript Based Scalable Software:
Pedro Teixeira
ISBN: 978-1-1181-8546-9
Paperback
408 pages
October 2012
£29.99 / €36.00
[http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118185463,descCd-google_preview.html]
Hands-on Node.js:
Pedro Teixeira
In this e-book we will analyze what makes Node a different proposal from all that is out there, why you should use it, and how to get started. It starts with an overview but quickly dives into the code, module by module. By the end of this book you should be able to build your own Node service producers and consumers, and also feel comfortable around the Node API and conventions.
By the end of it you should be able to build your own Node modules, as well as test and debug them.
[https://leanpub.com/hands-on-nodejs]
AddressWpg::
* https://blog.nodeswat.com/set-up-a-secure-node-js-web-application-9256b8790f11,
Top Five Security Tips:
by Karl Düüna
Secure the environment
To build a secure system, you need to start from the ground up and invest time in securing the environment.
Otherwise your code might be secure, but attackers can still compromise your application by exploiting weaknesses on your servers instead.
Make sure you run up-to-date software, have secure authentication mechanisms, run the application under low privileges, and have decent logging.
Validate all input
Hacking in general means finding an unexpected usage for a system by introducing an unexpected input.
The best way to defend yourself is to allow as narrow of an input range as possible.
It is equally important to always validate that there is a match between the input and your expectations.
Secure your data
Data and databases are a critical part of most web applications and therefore a prime target for attackers.
While Node.js applications might be more inclined towards NoSQL, the principles of data protection are the same: always use authentication mechanisms, use varying levels of access, separate your customers' data as much as needed or possible, and encrypt the important parts of the database.
Protect your clients
Clients are probably the most valuable asset of your web application—they use the system and bring in the business.
So it is natural that you must protect them with the same vigilance.
This, alongside other defenses, means you must invest in protecting the client side of your application, including setting up CSRF and XSS defenses, protecting against clickjacking and unvalidated redirects.
Implement “Defense in Depth”
Cyber-defense is an asymmetrical problem: while crackers need only one of their attacks to succeed, you need all of your defenses to hold.
This is unrealistic, which is why you should always opt for “Defense In Depth.” Never assume that the outer defenses of your application are impenetrable.
Instead, set up layers upon layers of defensive mechanisms.
Even if the attacker manages to get through one layer, the damage they can do is limited.
[https://pragprog.com/book/kdnodesec/secure-your-node-js-web-application]
Generic::
* Ljs-tool,
Name::
* cpt.Ljn-tool,
* cpt.Ljn-tool,
Specific::
* build-tool,
* code-analysis-tool,
* debugger-tool,
* editor-tool,
* package-manager-tool,
* testing-tool,
* version-manager-tool,
=== instance:
* interpreter-(runtime)-tool,
* npm-tool,
* REPL-tool,
Name::
* cpt.Ljn-tool.build,
* cpt.Ljn-build-tool,
Resource:
* http://blog.millermedeiros.com/node-js-as-a-build-script/,
* http://walkercoderanger.com/blog/2015/06/state-of-js-build-tools-2015/,
Specific::
* build-tools,
* Grunt,
* Gulp,
* Jake,
Name::
* cpt.Ljn-tool.code-analysis,
* cpt.Ljn-code-analysis-tool,
* cpt.Ljn-code-quality-tool,
* cpt.Ljn-static-code-analysis-tool,
Resource:
* https://www.jetbrains.com/help/webstorm/2016.2/using-javascript-code-quality-tools.html,
* https://www.smashingmagazine.com/2015/02/avoid-javascript-mistakes-with-static-code-analyzer/,
Name::
* cpt.Ljn-editor,
* cpt.Ljn-editor-tool,
* cpt.Ljn-editor,
* cpt.Ljn-edr,
Ljnedr.BEST:
My answer is Eclipse with Nodeclipse plugin, comparing to Visual Studio and Sublime Text.
[http://lith.me/2013/04/06/the-best-editor-for-node-js-on-windows/]
Description::
Scripted is a fast and lightweight code editor with an initial focus on javascript editing.
Scripted is a browser based editor and the editor itself is served from a locally running Node.js server instance.
[https://github.com/scripted-editor/scripted]
===
nodejs-server, js client.
Name::
* cpt.Ljn-version-manager,
* cpt.Ljn-version-manager,
Specific::
* nvm-windows - Windows Only,
* nvmw - Windows Only,
* nodist - Windows Only,
* nvm - Mac/Linux Only,
* n - Mac/Linux Only,
Generic::
* Ljs-testing-tool,
Name::
* cpt.Ljn-tool.testing,
* cpt.Ljn-testing,
* cpt.Ljn-testing,
Module:
* https://www.npmjs.org/package/nodeunit,
AddressWpg::
* http://visionmedia.github.io/mocha/
- https://brianstoner.com/blog/testing-in-nodejs-with-mocha/
* http://caolanmcmahon.com/posts/unit_testing_in_node_js/
* https://blog.risingstack.com/node-hero-node-js-unit-testing-tutorial/
Description:
npm is the default package manager for the JavaScript runtime environment Node.js.
[https://en.wikipedia.org/wiki/Npm_(software)]
Name::
* cpt.Ljn-npm,
* cpt.Ljn-npm-tool,
* cpt.Ljn-tool.npm,
* cpt.Ljn-npm,
* cpt.Ljn-npm-tool,
* cpt.Node.js-package-manager,
* cpt.Node-package-manager,
* cpt.Nodejs-package-manager,
* cpt.Npm,
* cpt.Npm-nodejs-package-manager,
* cpt.Npm-package-manager,
Description::
npm is the package manager for the Node javascript platform.
It puts modules in place so that node can find them, and manages dependency conflicts intelligently.
It is extremely configurable to support a wide variety of use cases.
Most commonly, it is used to publish, discover, install, and develop node programs.
Run npm help to get a list of available commands.
[https://npmjs.org/doc/cli/npm.html]
===
Node.js has a package manager, called Node Package Manager (NPM).
It is automatically installed with Node.js, and you use NPM to install new modules.
To install a module, open your terminal/command line, navigate to the desired folder, and execute the following command:
1 npm install module_name
It doesn't matter what OS you have; the above command will install the module you specify in place of module_name.
[http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/]
===
npm is a package manager for Node.js that is run through the command line and manages dependencies for an application.
It is the predominant package manager for Node.js.
According to its author, npm is not an acronym for "Node Package Manager".[1]
As of Node.js version 0.6.3, npm is deployed and installed automatically with the environment.
[http://en.wikipedia.org/wiki/Npm_(software)]
Installation:
NPM is included by default with Node.JS, starting with version 0.6.3.
Name::
* cpt.Ljn-npm'configuring,
* cpt.Npm'configuring,
AddressWpg::
* https://docs.npmjs.com/misc/config,
* https://docs.npmjs.com/files/npmrc,
* https://docs.npmjs.com/files/folders,
* https://docs.npmjs.com/files/package.json,
Name::
* cpt.Ljn-npm'command,
* cpt.Ljn-npm'cli-command,
* cpt.Npm'command,
* cpt.Npm'cli-command,
Command-flag::
(link)
Specific::
* Ljnnpm'access: Set access level on published packages
* Ljnnpm'adduser: Add a registry user account
* Ljnnpm'bin: Display npm bin folder
* Ljnnpm'bugs: Bugs for a package in a web browser maybe
* Ljnnpm'build: Build a package
* Ljnnpm'bundle: REMOVED
* Ljnnpm'cache: Manipulates packages cache
* Ljnnpm'completion: Tab Completion for npm
* Ljnnpm'config: Manage the npm configuration files
* Ljnnpm'dedupe: Reduce duplication
* Ljnnpm'deprecate: Deprecate a version of a package
* Ljnnpm'dist-tag: Modify package distribution tags
* Ljnnpm'docs: Docs for a package in a web browser maybe
* Ljnnpm'edit: Edit an installed package
* Ljnnpm'explore: Browse an installed package
* Ljnnpm'find: Search for packages
* Ljnnpm'help: Get help on npm
* Ljnnpm'help-search: Search npm help documentation
* Ljnnpm'init: Interactively create a package.json file
* Ljnnpm'install: Install a package
* Ljnnpm'install-test:
* Ljnnpm'link: Symlink a package folder
* Ljnnpm'logout: Log out of the registry
* Ljnnpm'ls: List installed packages
* Ljnnpm'npm: javascript package manager
* Ljnnpm'outdated: Check for outdated packages
* Ljnnpm'owner: Manage package owners
* Ljnnpm'pack: Create a tarball from a package
* Ljnnpm'ping: Ping npm registry
* Ljnnpm'prefix: Display prefix
* Ljnnpm'prune: Remove extraneous packages
* Ljnnpm'publish: Publish a package
* Ljnnpm'rebuild: Rebuild a package
* Ljnnpm'repo: Open package repository page in the browser
* Ljnnpm'restart: Restart a package
* Ljnnpm'root: Display npm root
* Ljnnpm'run-script: Run arbitrary package scripts
* Ljnnpm's: Search for packages
* Ljnnpm'se: Search for packages
* Ljnnpm'search: Search for packages
* Ljnnpm'shrinkwrap: Lock down dependency versions
* Ljnnpm'star: Mark your favorite packages
* Ljnnpm'stars: View packages marked as favorites
* Ljnnpm'start: Start a package
* Ljnnpm'stop: Stop a package
* Ljnnpm'tag: Tag a published version
* Ljnnpm'team: Manage organization teams and team memberships
* Ljnnpm'test: Test a package
* Ljnnpm'uninstall: Remove a package
* Ljnnpm'unpublish: Remove a package from the registry
* Ljnnpm'update: Update a package
* Ljnnpm'version: Bump a package version
* Ljnnpm'view: View registry info
* Ljnnpm'whoami: Display npm username
[Ljnnpm'https://docs.npmjs.com/]
AddressWpg::
* https://npmjs.org/
* http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/
* https://github.com/joyent/node/wiki/modules, (deprecated)
* https://nodejsmodules.org/
* http://nodetoolbox.com/
* http://eirikb.github.io/nipster/ 37,093 entries
Description::
The semantic versioner for npm
Usage
$ npm install semver
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean(' =v1.2.3 ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
[https://docs.npmjs.com/misc/semver]
Name::
* cpt.Ljn-npm'semantic-versioner,
* cpt.Ljn-npm'semver,
Version:
> npm -v
3.9.5
===
AddressWpg::
* https://github.com/npm/npm/tags,
Description::
The repl module provides a Read-Eval-Print-Loop (REPL) implementation that is available both as a standalone program or includable in other applications.
It can be accessed using:
const repl = require('repl');
[https://nodejs.org/docs/v6.3.1/api/repl.html#repl_repl]
Name::
* cpt.Ljn-REPL,
* cpt.Ljn-REPL-program,
* cpt.Ljn-Read-Eval-Print-Loop,
* cpt.Ljn-rpl,
Executing:
On a-terminal write node
.
You will see its command-prompt (>).
Commands:
> .help
.break Sometimes you get stuck, this gets you out
.clear Alias for .break
.exit Exit the repl
.help Show repl options
.load Load JS from a file into the REPL session
.save Save all evaluated commands in this REPL session to a file
Name::
* cpt.Ljn-REPL-module,
* cpt.Ljn-repl-module,
Ljnrepl'Member::
// ljn.6-2-2
> Object.getOwnPropertyNames(repl).sort()
[ 'REPLServer', 'REPL_MODE_MAGIC', 'REPL_MODE_SLOPPY', 'REPL_MODE_STRICT', 'Recoverable', '_builtinLibs', 'repl', 'start', 'writer' ]
Description::
Node.js® is a javascript runtime built on Chrome's V8 javascript engine.
Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
[https://nodejs.org/en/] {2016.07.01}
Name::
* cpt.Node.js,
* cpt.Node.js-interpreter,
* cpt.Node.js-runtime,
* cpt.Ljn-interpreter,
* cpt.Ljn-runtime,
* cpt.Ljn-interpreter,
* cpt.Ljn-runtime,
Description::
Usage:
> node [options] [v8 options] [script.js | -e "script"] [arguments]
Name::
* cpt.Ljn-rtm'synopsis,
* cpt.Ljn-rtmsps,
Name::
* cpt.Ljn-rtmopn,
* cpt.Ljn-rtm'option,
* cpt.Ljn-rtm'CLI-option,
Specific::
Options
-v, --version
-h, --help
-e, --eval "script"
-p, --print "script"
-c, --check
-i, --interactive
-r, --require module
--no-deprecation
--trace-deprecation
--throw-deprecation
--no-warnings
--trace-warnings
--trace-sync-io
--zero-fill-buffers
--preserve-symlinks
--track-heap-objects
--prof-process
--v8-options
--tls-cipher-list=list
--enable-fips
--force-fips
--icu-data-dir=file
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_command_line_options]
-v, --version
Added in: v0.1.3
Print node's version.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_v_version]
-h, --help
Added in: v0.1.3
Print node command line options. The output of this option is less detailed than this document.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_h_help]
-e, --eval "script"
Added in: v0.5.2
Evaluate the following argument as JavaScript.
The modules which are predefined in the REPL can also be used in script.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_e_eval_script]
-p, --print "script"
Added in: v0.6.4
Identical to -e but prints the result.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_p_print_script]
-c, --check
Added in: v5.0.0
Syntax check the script without executing.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_c_check]
-i, --interactive
Added in: v0.7.7
Opens the REPL even if stdin does not appear to be a terminal.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_i_interactive]
-r, --require module
Added in: v1.6.0
Preload the specified module at startup.
Follows require()'s module resolution rules.
module may be either a path to a file, or a node module name.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_r_require_module]
--no-deprecation
Added in: v0.8.0
Silence deprecation warnings.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_no_deprecation]
--trace-deprecation
Added in: v0.8.0
Print stack traces for deprecations.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_trace_deprecation]
--throw-deprecation
Added in: v0.11.14
Throw errors for deprecations.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_throw_deprecation]
--no-warnings
Added in: v6.0.0
Silence all process warnings (including deprecations).
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_no_warnings]
--trace-warnings
Added in: v6.0.0
Print stack traces for process warnings (including deprecations).
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_trace_warnings]
--trace-sync-io
Added in: v2.1.0
Prints a stack trace whenever synchronous I/O is detected after the first turn of the event loop.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_trace_sync_io]
--zero-fill-buffers
Added in: v6.0.0
Automatically zero-fills all newly allocated Buffer and SlowBuffer instances.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_zero_fill_buffers]
--preserve-symlinks
Added in: v6.3.0
Instructs the module loader to preserve symbolic links when resolving and caching modules.
By default, when Node.js loads a module from a path that is symbolically linked to a different on-disk location, Node.js will dereference the link and use the actual on-disk "real path" of the module as both an identifier and as a root path to locate other dependency modules.
In most cases, this default behavior is acceptable.
However, when using symbolically linked peer dependencies, as illustrated in the example below, the default behavior causes an exception to be thrown if moduleA attempts to require moduleB as a peer dependency:
{appDir}
├── app
│ ├── index.js
│ └── node_modules
│ ├── moduleA -> {appDir}/moduleA
│ └── moduleB
│ ├── index.js
│ └── package.json
└── moduleA
├── index.js
└── package.json
The --preserve-symlinks command line flag instructs Node.js to use the symlink path for modules as opposed to the real path, allowing symbolically linked peer dependencies to be found.
Note, however, that using --preserve-symlinks can have other side effects.
Specifically, symbolically linked native modules can fail to load if those are linked from more than one location in the dependency tree (Node.js would see those as two separate modules and would attempt to load the module multiple times, causing an exception to be thrown).
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_preserve_symlinks]
--track-heap-objects
Added in: v2.4.0
Track heap object allocations for heap snapshots.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_track_heap_objects]
--prof-process
Added in: v6.0.0
Process v8 profiler output generated using the v8 option --prof.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_prof_process]
--v8-options
Added in: v0.1.3
Print v8 command line options.
Note: v8 options allow words to be separated by both dashes (-) or underscores (_).
For example, --stack-trace-limit is equivalent to --stack_trace_limit.
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_v8_options]
--tls-cipher-list=list
Added in: v4.0.0
Specify an alternative default TLS cipher list. (Requires Node.js to be built with crypto support. (Default))
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_tls_cipher_list_list]
--enable-fips
Added in: v6.0.0
Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with ./configure --openssl-fips)
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_enable_fips]
--force-fips
Added in: v6.0.0
Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.) (Same requirements as --enable-fips)
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_force_fips]
--icu-data-dir=file
Added in: v0.11.15
Specify ICU data load path. (overrides NODE_ICU_DATA)
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_icu_data_dir_file]
Description::
process.argv
Added in: v0.1.27
(Array)
The process.argv property returns an array containing the command line arguments passed when the Node.js process was launched. The first element will be process.execPath. See process.argv0 if access to the original value of argv[0] is needed. The second element will be the path to the JavaScript file being executed. The remaining elements will be any additional command line arguments.
For example, assuming the following script for process-args.js:
// print process.argv
process.argv.forEach((val, index) => {
console.log(`${index}: ${val}`);
});
Launching the Node.js process as:
$ node process-2.js one two=three four
Would generate the output:
0: /usr/local/bin/node
1: /Users/mjr/work/node/process-2.js
2: one
3: two=three
4: four
[https://nodejs.org/docs/latest/api/process.html#process_process_argv]
Description::
Download (https://nodejs.org/en/) msi file and run it.
Description::
At Least from Ubuntu 12.04, an old version (0.6.x) of Node is in the standard repository.
To install, just run:
> sudo apt-get install nodejs
[https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint]
Building From Source
To build and install node from source, we first need to obtain the code.
The first method of doing so is via git, if you have git installed you can execute:
$ git clone http://github.com/ry/node.git && cd node
For those without git, or who prefer not to use it, we can also download the source via curl, wget, or similar:
$ curl -# http://nodejs.org/dist/node-v0.1.99.tar.gz > node.tar.gz
$ tar -zxf node.tar.gz
Now that we have the source on our machine, we can run ./configure which discovers which libraries are available for node to utilize such as OpenSSL for transport security support, C and C++ compilers, etc. make which builds node, and finally make install which will install node.
$ ./configure && make && make install
[http://visionmedia.github.com/masteringnode/book.html]
Name::
* cpt.Ljn-rtmenv,
* cpt.Ljn-rtm'environment-variable,
* cpt.Ljn-environment-variable,
Setting:
It depends on your system.
On linux with bash: export ENV_VAR=value
On windows: set ENV_VAR=value
Specific::
* NODE_DEBUG,
* NODE_DISABLE_COLORS,
* NODE_ICU_DATA,
* NODE_PATH,
* NODE_REPL_HISTORY,
[https://nodejs.org/docs/v6.3.1/api/cli.html#cli_environment_variables]
Generic::
* Ljs-learning,
Name::
cpt.ljn'learning,
cpt.ljnlearning,
Resource:
* https://blog.risingstack.com/node-hero-tutorial-getting-started-with-node-js/,
Name::
* cpt.Ljn.evoluting,
* cpt.Ljn.evolution,
* cpt.Ljn-evolution,
* cpt.Ljn-evolution,
Time:
Node.js was originally written in 2009 by Ryan Dahl.
The initial release supported only Linux.
Its development and maintenance was led by Dahl and later sponsored by Joyent.
Dahl was inspired to create Node.js after seeing a file upload progress bar on Flickr.
The browser did not know how much of the file had been uploaded and had to query the Web server.
Dahl desired an easier way.
Dahl demonstrated the project at the inaugural European JSConf on November 8, 2009.
Node.js combined Google's V8 javascript engine, an event loop and a low-level I/O API.
The project received a standing ovation.
In 2011, a package manager was introduced for the Node.js environment called npm.
The package manager makes it easier for programmers to publish and share source code of Node.js libraries and is designed to simplify installation, updating and uninstallation of libraries.
In June 2011, Microsoft and Joyent implemented a native Windows version of Node.js.
The first Node.js build supporting Windows was released in July 2011.
In January 2012, Dahl stepped aside, promoting coworker and npm creator Isaac Schlueter to manage the project.
In January 2014, Schlueter announced that Timothy J. Fontaine would lead the project.
In December 2014, Fedor Indutny started io.js, a fork of Node.js.
Due to the internal conflict over Joyent's governance, io.js was created as an open governance alternative with a separate technical committee.
Unlike Node.js, the authors planned to keep io.js up-to-date with the latest releases of the Google V8 javascript engine.
In February 2015, the intent to form a neutral Node.js Foundation was announced.
By June 2015, the Node.js and io.js communities voted to work together under the Node.js Foundation.
In September 2015, Node.js v0.12 and io.js v3.3 were merged back together into Node v4.0.
This brought V8 ES6 features into Node.js, and a long-term support release cycle.
As of 2016, the io.js website recommends that developers switch back to Node.js.
[https://en.wikipedia.org/wiki/Node.js#History]
Name::
* cpt.Ljn.version,
* cpt.Ljn-version,
* cpt.Ljn-version,
resource:
* https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V6.md,
Ljn.6-0-0.2016-04-26:
* changelog,
* The v6 release line will be covered by the Node.js Long Term Support plan starting in October 2016.
* 6.0.0 (current) - 6-3-0.2016-07-06 (current),
Ljn.5-0-0.2015-10-29:
* changelog,
* Official support for the v5 release line is scheduled to expire around June 2016. Users of v5 should upgrade to Node.js v6.
* 5.0.0 (stable) - 5.12.0 (stable),
Ljn.4-0-0.2015-10-07:
* changelog,
* Node.js v4 is covered by the Node.js Long Term Support Plan and will be supported actively until April 2017 and maintained until April 2018.
* 4.0.0 (stable) - 4-4-7.2016-06-28 (LTS),
Ljn.0-12-0.2015-02-06:
* changelog,
* Node.js v0.12 is covered by the Node.js Long Term Support Plan and will be maintained until December 31st, 2016.
* 0.12.0 (stable) - 0.12.15-2016.06.23 (maintenance),
Ljn.0-11-0.2013-03-28:
* changelog,
* 0.11.0 (unstable) - 0.11.14 (unstable),
Ljn.0-10-0.2013-03-11:
* changelog,
* 0.10.0 (stable) - 0.10.46 (maintenance),
Ljn.0-9-0.2012-07-20:
* changelog,
* 0.9.0 (unstable) - 0.9.12 (unstable),
Ljn.0-8-0.2012-06-25:
* changelog,
* 0.8.0 (stable) - 0.8.25 (maintenance),
Ljn.0-7-0.2012-01-16:
* changelog,
* 0.7.0 (unstable) - 0.7.12 (unstable),
Ljn.0-6-0.2011-11-04:
* changelog,
* 0.6.0 (stable) - 0.6.20 (maintenance),
Ljn.0-5-0.2011-07-05:
* changelog,
* 0.5.0 - 0.5.10,
Ljn.0-4-0.2011-02-10:
* changelog,
* 0.4.0 - 0.4.12,
Ljn.0-3-0.2010-10-23:
* changelog,
* 0.3.0 - 0.3.8,
Ljn.0-2-0.2010-08-20:
* changelog,
* 0.2.0,
Ljn.0-1-0.2009-06-30:
* changelog,
* 0.1.0 - 0.1.104,
Ljn.0-0-3.2009-06-11:
* changelog,
0.0.3 - 0.0.6
This page was visited times since {2016.05.04}
Page-path: synagonism.net / Hitp / ModelInfoWorld / Javascript / Node-js
SEARCH THE-PAGE:
This page uses 'locator-names', names that when you find them, you find the-LOCATION of the-concept they denote.
Type CTRL+F "cpt.[ljs|ljb|ljn]words-of-concept's-name", to go to the-LOCATION of the-concept.
There are about 400 sub-concepts in this concept (ebook) with 1,400 names and 14,000 lines of hitp-document.
Webpage-Versions:
• version.dynamic: filMcsLjn.html,
• version.4.2017-07-11: filMcsLjn.4.2017-07-11.html,
• version.3.2016-08-22 (2-4): filMcsLjs.3.2016-08-22.html,
• version.2.2016-08-04.ljs-ljn (1-33): filCptLjs.2.2016-08-04.html,
• version.1-21.2016-05-26: lngJs.1-21.2016-05-26.html,
• version.1-17.2016-05-23: lngJs.1-17.2016-05-23.html,
• version.1-11.2016-05-18: lngJs.1-11.2016-05-18.html,
• version.1.2016-05-10.ljb.created: lngJs.1.2016-05-10.html,