Javascript (ljs) is the GENERIC language of browser-javascript (ljb, client-side) and Node-javascript (ljn, server-side) and other differentiations.
Javascript was originally developed in {1995} by Brendan-Eich, at Netscape-Communications-Corporation. [en.wikipedia.org]
My goal here is my text to be MONOSEMANTIC as possible, in contrast to existing texts, by defining most of the-names of my sentences.
ALSO, my text differs than the traditional one.
I publish STRUCTURED-CONCEPTS (with attributes also concepts) in contrast to traditional text, that describes concepts.
This is a living concept (= an evolving concept), see and reference by version.
Version last.minor is dynamic (do not reference with it), all others are static.
Even though the-work I have-put on this webpage-concept is NOT a small amount, much more is needed.
Name:
* cpt.language.javascript,
* cpt.javascript,
* cpt.ljs,
* javascript-cpt,
* ljs-cpt,
History:
Although it was developed under the name Mocha, the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript when it was deployed in the Netscape browser version 2.0B3.
The change of name from LiveScript to javascript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator Web browser.
The final choice of name caused confusion, giving the impression that the language was a spin-off of the Java programming language, and the choice has been characterized as a marketing ploy by Netscape to give javascript the cachet of what was then the hot new Web programming language.
[https://en.wikipedia.org/wiki/javascript#Beginnings_at_Netscape]
"JavaScript" is a trademark of Oracle Corporation.
It is used under license for technology invented and implemented by Netscape Communications and current entities such as the Mozilla Foundation.
[https://en.wikipedia.org/wiki/JavaScript#Trademark]
===
THEN, JavaScript (with JS capital) is the-javascript of Mozilla.
I am-using the-names 'javascript' and 'ljs' for the generic language.
[Synagonism.2016-07-22]
Generic-chain:
* programing-language,
* computer-language,
* mapping-method,
* method,
* info,
* model,
* entity,
Description:
All languages, human and computer, MAP (represent | translate) one entity (the-archetype) to another (the-model|the-code), for a-communication reason.
Programing-languages map human-information and human-information-processing in a-format that machines can process.
A-programer MUST-KNOW an-archetype first, in order to create a-program.
Name:
* cpt.ljs'archetype,
* cpt.ljsarcho,
Specific:
* ljb-archetype,
* ljn-archetype,
Description:
An-archetype[1] in programming-languages, usually, is a-doing of processing information by humans.
In order to do this process a-machine, a-programer must translate|represent it[1] in a-format with a-programing-language's constructs.
This representation (model) is an-algorithm.
The-programer first is-thinking the-algorithm in his native-natural-language, but writes down it in a-format that machines understand, the-code.
An-algorithm is a-document with a whole-part-tree structure, the-syntax-tree.
Name:
* cpt.ljs'algorithm,
* cpt.ljs'model,
* cpt.ljsalgo,
* cpt.ljsdoc,
* cpt.ljs'doc,
Description:
An-algorithm can-be-written in many formats, natural-language, flowchart, code.
All formats represent information (archetypes) that machines can PROCESS but machines do-not-UNDERSTAND, at least today, all formats and this is the-reason for programing-languages existence.
Natural-language is a human-friendly format, but unfriendly for the-machines.
Flowchart, is a graphical format, like the natural-language format.
Code, is the-format that programing-language define and understand the-machines.
Name:
* cpt.ljs'algo'format,
* cpt.ljsalgo'format,
* cpt.ljsalgo-format,
Specific:
* Natural-language,
* Flowchart,
* Code,
* Web-IDL,
Description:
The-code[1] is a-format of an-algorithm that is-understood both by humans and machines and it[1] is-defined by the-language.
Name:
* cpt.ljs'code,
* cpt.ljscode,
* cpt.ljscode-format,
* cpt.ljssource-code,
* cpt.ljscod,
* source-code-cpt,
Description:
An-algorithm is a-MODEL of an-archetype constructed as the-language defines.
THE-STRUCTURE of an-algorithm is a-WHOLE-PART-TREE of units, semantic-units, phrases, sentences, sections of the-language which parts we define in the-next sections.
This whole-part-tree is the-syntax-tree of an-algorithm.
In contrast, the-API of the-language, is structured in a-whole-part-tree and in a-generic-part-tree.
Name:
* cpt.ljs'algorithm-tree,
* cpt.ljs'syntax-tree,
* cpt.ljs'syntax-whole-part-tree,
* cpt.ljs'syntax-wptree,
* cpt.ljssyntax-tree,
Description:
In order to create an-algorithm in any format, we must use other entities, that REPRESENT NOTHING in archetype and are INDIVISIBLE.
These are the-units of the-algorithm, and the entire algorithm is a whole-part-tree system of constructs of these units.
Natural-languages use sounds or symbols.
Flowcharts use graphs.
Code uses computer-symbols, the-unicode-characters, groups of bits in binary-code.
Ljb and ljn use the same code-units.
Name:
* cpt.ljs'algo-unit,
* cpt.ljs'unit,
* cpt.ljsunit,
Description:
Code-units are the-units of code.
Ljs-code is case-sensitive and its units are the-Unicode character-set.
Name:
* cpt.ljs'code-unit,
* cpt.ljsunit.code,
* cpt.ljscode-unit,
Description:
Words are combinations of units, that REPRESENT NOTHING, the-language uses to create whole constructs with meaning (= denote archetype).
Description:
An-algorithm is a-document with a-whole-part-tree-structure created by combining simpler parts.
The-units (indivisible parts) that DENOTE ARCHETYPE, used to create an-algorithm, are the-semantic-units.
Programing-languages use different semantic-units and combinations of semantic-units to create algorithms that map the same archetype.
Name:
* cpt.ljs'semantic-unit,
* cpt.ljssemantic-unit,
* cpt.ljsunit.semantic,
* cpt.ljssut,
* cpt.ljssunit,
* cpt.ljsuntSmc,
Whole-chain:
=== (syntax-wptree)
* ljs-phrase,
* ljs-sentence,
* ljs-section,
* ljs-library,
* ljs-program,
=== (API-wptree)
* another semantic-unit,
...
* most-whole-object,
Generic-chain:
* object,
or
* objectNo,
Description:
Code-semantic-unit is a-semantic-unit written in code-format.
Name:
* cpt.ljs'semantic-unit.code,
* cpt.ljssemantic-unit.code,
* cpt.ljscode-semantic-unit,
Specific:
Ljs uses only 12 semantic-units to create algorithms:
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,
Specific.alphabetically:
* array--semantic-unit,
* boolean--semantic-unit,
* custom--semantic-unit,
* customNo--semantic-unit,
* function--semantic-unit,
* ljb-semantic-unit,
* ljn-semantic-unit,
* name-semantic-unit,
* nameNo-semantic-unit,
* name-value-pair-mixed--semantic-unit,
* name-value-pair-mixedNo--semantic-unit,
* name-value-pair-No--semantic-unit,
* null--semantic-unit,
* number--semantic-unit,
* object--semantic-unit,
* objectNo--semantic-unit,
* regexp--semantic-unit,
* string--semantic-unit,
* undefined--semantic-unit,
Specific:
* ljb-semantic-unit,
* ljn-semantic-unit,
Specific:
* object-semantic-unit,
* objectNo-semantic-unit,
Description:
ObjectNo is a-semantic-unit which is NOT object, it is NOT specific of Object.prototype.
Only 2 semantic-units are not objects: null
, undefined
.
Name:
* cpt.ljsobjectNo-semantic-unit,
* cpt.ljs'objectNo,
* cpt.ljsobjectNo,
Specific:
* name-semantic-unit,
* nameNo-semantic-unit,
Description:
NameNo is a-semantic-unit which HAS NO a-name associated with it.
Name:
* cpt.ljs'anonymous-semantic-unit,
* cpt.ljsanonymous-semantic-unit,
* cpt.ljsnameNo-semantic-unit,
* cpt.ljsname-value-pair-No-semantic-unit,
* cpt.ljs'nameNo,
* cpt.ljsnameNo,
Specific:
* custom-semantic-unit,
* customNo-semantic-unit,
Description:
A-semantic-unit created by a-programer.
Name:
* cpt.ljs'builtinNo-semantic-unit,
* cpt.ljsbuiltinNo-semantic-unit,
* cpt.ljs'custom-semantic-unit,
* cpt.ljscustom-semantic-unit,
* cpt.ljs'nativeNo-semantic-unit,
* cpt.ljsnativeNo-semantic-unit,
* cpt.ljs'standardNo-semantic-unit,
* cpt.ljsstandardNo-semantic-unit,
Description:
A-semantic-unit created by the-language-creator.
Name:
* cpt.ljs'builtin-semantic-unit,
* cpt.ljs'built-in-semantic-unit,
* cpt.ljs'customNo-semantic-unit,
* cpt.ljs'native-semantic-unit,
* cpt.ljs'standard-semantic-unit,
* cpt.ljsbuiltin-semantic-unit,
* cpt.ljsbuilt-in-semantic-unit,
* cpt.ljscustomNo-semantic-unit,
* cpt.ljsnative-semantic-unit,
* cpt.ljsstandard-semantic-unit,
Description:
Array is an-ordered-collection of other semantic-units.
Code-example:
var a = [true, 1, {n:1}, /d/, 's'];
Name:
* cpt.ljs'array,
* cpt.ljsarray,
* cpt.ljsa,
Generic-chain:
* Array.prototype, ([].__proto__ === Array.prototype //true
)
* Object.prototype, ([].__proto__.__proto__ === Object.prototype //true
)
Description:
Code:
var a1 = [1, 's'];
//===
var a2 = new Array(1, 's');
Name:
* cpt.ljsa'creation,
* cpt.ljs'array'creation,
* cpt.ljsarray'creation,
Description:
Elements|items are the-entities an-array contains.
To access them ljs uses the-code:
a[nIndex]
Name:
* cpt.ljs'array'element,
* cpt.ljsarray'element,
* cpt.ljsa'element,
* cpt.ljsarray'item,
* cpt.ljsa'item,
Description:
Index-of-array is a-number (starts with 0) that denotes the-order of one of its elements.
Name:
* cpt.ljs'array'index,
* cpt.ljsarray'index,
* cpt.ljsa'index,
Description:
Arrays are-considered objects of the-Array-constructor-function, with generic the-Array.prototype-object.
In other words, the-members of the-Array.prototype are-inherited by all arrays.
Also, any array[1] can-have extra members in addition to its[1] inherited members and to its[1] elements.
Code:
a.n = 3;
Name:
* cpt.ljs'array'member,
* cpt.ljsarray'member,
* cpt.ljsa'member,
Description:
Array
is a-built-in-function and is-considered the-constructor, of all arrays.
Then, Array.prototype is the-parent-generic-object of all arrays.
Name:
* cpt.ljsf.Array,
* cpt.ljsArray,
* cpt.ljs'Array-constructor,
* cpt.ljsArray-constructor,
* cpt.ljsArray-constructor-function,
* cpt.ljs'Array-function,
* cpt.ljsArray-function,
Generic-chain:
* Function.prototype (Array.__proto__ === Function.prototype //true
),
* Object.prototype (Array.__proto__.__proto__ === Object.prototype //true
),
Description:
Array.prototype
is the-generic-object, of all arrays.
In other words, its members are-inherited by all arrays.
Name:
* cpt.ljso.Array.prototype,
* cpt.ljs'Array.prototype,
* cpt.ljsArray.prototype,
* cpt.ljsArray.prototype-object,
Generic-chain:
* Object.prototype (Array.prototype.__proto__ === Object.prototype //true
),
Member:
Code
(ljn.622):
> Object.getOwnPropertyNames(Array.prototype).sort()
[ 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift' ]
(Chrome.50):
> Object.getOwnPropertyNames(Array.prototype).sort()
["concat", "constructor", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "forEach", "includes", "indexOf", "join", "keys", "lastIndexOf", "length", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift"]
(Firefox.45):
> Object.getOwnPropertyNames(Array.prototype).sort()
["concat", "constructor", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "forEach", "includes", "indexOf", "join", "keys", "lastIndexOf", "length", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toSource", "toString", "unshift"]
(Edge.20):
> Object.getOwnPropertyNames(Array.prototype).sort()
["concat", "constructor", "copyWithin", "entries", "every", "fill", "filter", "find", "findIndex", "forEach", "indexOf", "join", "keys", "lastIndexOf", "length", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift", "values"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Array.prototype).sort()
["concat", "constructor", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "length", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift"]
Description:
Boolean is any of the two semantic-units: false, true.
Name:
* cpt.ljs'boolean,
* cpt.ljsboolean,
* cpt.ljsb,
* ljsboolean-cpt,
* ljsb-cpt,
Generic-chain:
* Boolean.prototype, (true.__proto__ === Boolean.prototype //true
)
* Object.prototype, (true.__proto__.__proto__ === Object.prototype //true
)
Description:
Boolean.prototype
is the-generic-object, of booleans.
In other words, its members are-inherited by booleans.
Name:
* cpt.ljso.Boolean.prototype,
* cpt.ljs'Boolean.prototype,
* cpt.ljsBoolean.prototype,
* cpt.ljsBoolean.prototype-object,
Generic-chain:
* Object.prototype (Boolean.prototype.__proto__ === Object.prototype //true
),
Member:
(ljn.630):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
[ 'constructor', 'toString', 'valueOf' ]
(Chrome.50):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
["constructor", "toString", "valueOf"]
(Firefox.46):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
["constructor", "toSource", "toString", "valueOf"]
(Edge.20):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
["constructor", "toString", "valueOf"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Boolean.prototype).sort()
["constructor", "toString", "valueOf"]
Description:
Function is the-semantic-unit that PROCESSES information.
Optionally has input and output.
Name:
* cpt.ljs'function,
* cpt.ljsfunction,
* cpt.ljsf,
* ljsfunction-cpt,
* ljsf-cpt,
Whole-chain:
* the-semantic-unit in which defined,
...
* most-whole-object,
Generic-chain:
* Function.prototype, (var f = function(){}; f.__proto__ === Function.prototype //true
)
* Object.prototype, (f.__proto__.__proto__ === Object.prototype //true
)
Description:
With a-compound-sentence, we define|create a-function.
We define its input, output and what info-processing will-do.
Code:
function fName() { // inside parentheses we write the input identifiers
//what to do
//last, what to return
}
or
var fName = function() {
//what to do
//last, what to return
}
In the second case, we define one name-value-pair with name fName
and value an anonymous function.
Name:
* cpt.ljs'function-creation,
* cpt.ljsfunction-creation,
* cpt.ljs'function-definition,
* cpt.ljsfunction-definition,
* cpt.ljsf'creation,
* cpt.ljsf'definition,
Description:
Function-call is the-process of setting a-function to work.
We define a-function once, we call it as many times as we wish.
We use the next phrase, to call a-function.
Code:
fName()
Inside the-parentheses we put the-values of the-identifiers used in the-definition.
Name:
* cpt.ljs'function-call,
* cpt.ljsfunction-call,
* cpt.ljs'function-execution,
* cpt.ljsfunction-execution,
* cpt.ljs'function-invocation,
* cpt.ljsfunction-invocation,
* cpt.ljsf'call,
* cpt.ljsf'execution,
* cpt.ljsf'invocation,
Description:
Function's-input is optional information (semantic-units) we give to a-function to do its work.
Name:
* cpt.ljs'function-input,
* cpt.ljsfunction-input,
* cpt.ljsfunction's-input,
* cpt.ljsf'input,
Function's-parameter:
In a-function's-definition, as input information we do-not-give values, we give identifiers of name-value-pairs.
These input identifiers are-called PARAMETERS.
I use the-notation: xNameIn
where 'x' denotes what semantic-unit is.
Function's-argument:
When we call a-function, as input information we give values, not identifiers.
These input values are-called ARGUMENTS.
Description:
Function's-output is optional information (semantic-unit) we could-RECEIVE from a-function.
If a-function has no output, then the-output is-considered the-undefined-semantic-unit.
Name:
* cpt.ljs'function-output,
* cpt.ljsfunction-output,
* cpt.ljsfunction's-output,
* cpt.ljsf'output,
Return-sentence:
The last sentence in the-definition-of-a-function is the-return-sentence, the-sentence that denotes what the-function will return.
Code: return o;
Name:
* cpt.ljs'return-sentence,
* cpt.ljsreturn-sentence,
* cpt.ljs'return-statement,
* cpt.ljsreturn-statement,
* cpt.ljs'sentence.return,
* cpt.ljssentence.return,
Description:
The-name of a-function it's a little tricky business.
In this definition: function f(){}
, the-name is 'f': f.name //"f"
In this definition: var f = function(){}
, there is no name: f.name //""
In this definition: var f1 = function f2(){}
, the-name is 'f2': f1.name //"f2"; f2.name //error
In all other name-value-pairs we consider the-identifier as 'name'.
So when we need to create recursive-functions (= functions which call themselves), we use the first definition where the-name and the-reference to the-function are the-same.
Description:
This natural-language sentence is ambiguous.
First of all, the-verb 'is' has many meanings, eg 'has', 'is-specific-of', 'is-part-of' etc.
In javascript means that a-function is specific of the-object Object.prototype
, then and a-function is an-object.
Thus, a-function can-have members, like an-object.
A-function has the-members of its generics-chain.
BUT a-function has and other characteristics that an-object can-not have.
We can-call a-function, but not an-object.
Then, the correct sentence is: A-function is a specific of Object.prototype.
Description:
Function.prototype
[1] is the-generic-object, of all functions.
In other words, its[1] members are-inherited by all functions.
Usually, Constructor.prototype
is an-object.
But Function.prototype
is a-function: typeof Function.prototype //"function"
Name:
* cpt.ljs'Function.prototype,
* cpt.ljsFunction.prototype,
* cpt.ljsFunction.prototype-function,
* cpt.ljsf.Function.prototype,
Whole-chain:
* Function,
* most-whole-object,
Generic-chain:
* Object.prototype (Function.prototype.__proto__ === Object.prototype //true
),
Member:
Code (Chrome.50):
> Object.getOwnPropertyNames(Function.prototype).sort()
["apply", "arguments", "bind", "call", "caller", "constructor", "length", "name", "toString"]
(Firefox.46):
> Object.getOwnPropertyNames(Function.prototype).sort()
["apply", "arguments", "bind", "call", "caller", "constructor", "isGenerator", "length", "name", "toSource", "toString"]
(Edge.20):
> Object.getOwnPropertyNames(Function.prototype).sort()
["apply", "arguments", "bind", "call", "caller", "constructor", "length", "name", "toString"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Function.prototype).sort()
["apply", "bind", "call", "constructor", "length", "name", "toString"]
Specific:
* Function,
* Object,
* ...
* all builtin functions,
* all custom-functions,
Description:
Function
is the-constructor, of all functions:
> var f = function(){};
undefined
> f.constructor
function Function() { [native code] }
Name:
* cpt.ljsFunction,
* cpt.ljs'Function-constructor,
* cpt.ljsFunction-constructor,
* cpt.ljs'Function-function,
* cpt.ljsFunction-function,
Whole-chain:
* most-whole-object,
Generic-chain:
* Function.prototype, (Function.__proto__ === Function.prototype //true
),
It is important to mention here that Function
CONTAINS its generic-object, the-Function.prototype.
* Object.prototype, (Function.__proto__.__proto__ === Object.prototype //true
)
Member:
Code (Chrome.50):
> Object.getOwnPropertyNames(Function).sort()
[]
(Firefox.46):
> Object.getOwnPropertyNames(Function).sort()
[]
(Edge.20):
> Object.getOwnPropertyNames(Function).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Function).sort()
[]
Specific.alphabetically:
* constructor-function,
* custom-function,
* customNo-function,
* method-function,
* methodNo-function,
* named-function,
* namedNo-function,
* object-returning-function,
* operator-function,
* self-executing-function,
Description:
Constructor is any function used to create objects.
Code:
var o = new fName();
Name:
* cpt.ljs'constructor,
* cpt.ljsconstructor,
* cpt.ljsconstructor-function,
* cpt.ljsf.constructor,
* cpt.ljsfunction.constructor,
===
Usually the-names of individual constructors begin with capital-letters.
Constructor.prototype:
The-members of this special member of a-constructor, are-inherited by the-objects-created-by-a-constructor.
In other words, Constructor.prototype is the-generic-object of a-constructor's objects.
Description:
Method is a-function member of an-object.
Name:
* cpt.ljs'method,
* cpt.ljsmethod,
* cpt.ljs'function.method,
* cpt.ljsfunction.method,
* cpt.ljsf.method,
Description:
Named-function is a-function which has name.
// defined as:
function f(){};
// or
var f1 = function f2(){};
Name:
* cpt.ljs'named-function,
* cpt.ljs'function.named,
* cpt.ljsfunction.named,
* cpt.ljsf.named,
Description:
NamedNo-function is a-function which has NO name.
// defined as:
var f = function(){};
Name:
* cpt.ljs'anonymous-function,
* cpt.ljs'namedNo-function,
* cpt.ljs'function.namedNo,
* cpt.ljsfunction.namedNo,
* cpt.ljsf.namedNo,
Description:
Objects have no scope.
To overcome this, we create objects by creating functions[2], which have scope, that[1] return the-object we want.
Code:
function f() {
var n = 1;
function f1(){var n2 = n;}
return {
f1: f1;
n: n;
};
}
Name:
* cpt.ljs'object-factory-function,
* cpt.ljsobject-factory-function,
* cpt.ljs'object-returning-function,
* cpt.ljsobject-returning-function,
* cpt.ljs'function.object-returning,
* cpt.ljsfunction.object-returning,
* cpt.ljsf.object-factory,
* cpt.ljsf.object-returning,
Description:
Operators are special functions with code similar to natural-languages and names special-symbols and special syntax.
Operators[1] are built-in, and a-programer calls them[1].
Name:
* cpt.ljs'operator,
* cpt.ljsoperator,
* cpt.ljsopr,
Operand:
Description:
Operands are the INPUT information of operators.
Name:
* cpt.lsjoperand,
Specific.alphabetically:
* arithmetic-operator,
* assignment-operator,
* binary-operator,
* bitwise-operator,
* comma-operator,
* comparison-operator,
* conditional-operator,
* logical-operator,
* relational-operator,
* string-operator,
* ternary-operator,
* unary-operator,
Description:
Self-executing-function is a-function which defined and called at the same time.
Code:
(function() {
//what to do
//last, what to return
})();
Name:
* cpt.ljs'function.self-executing,
* cpt.ljsfunction.self-executing,
* cpt.ljsf.self-executing,
* cpt.ljs'self-executing-function,
* cpt.ljsself-executing-function,
Immediately-invoked-function-expression (IIFE):
It is the-sentence in the-code that defines and calls the-function.
Description:
Null is a special semantic-unit that denotes no-information, similar to zero quantity.
Name:
* cpt.ljs'null,
* cpt.ljsnull,
* cpt.ljsl,
* ljsnull-cpt,
* ljsl-cpt,
Generic-chain:
* objectNo,
* semantic-unit,
===
'null
is not an object'.
In other words, null
is NOT SPECIFIC of an-ljs-object, it does not inherit the-members of an-object.
Code:
null
Description:
Number is a-semantic-unit that denotes numbers in archetype.
Name:
* cpt.ljs'number,
* cpt.ljsnumber,
* cpt.ljsn,
* ljsn-cpt,
Generic-chain:
* Number.prototype, ((3).__proto__ === Number.prototype //true
)
* Object.prototype, ((3).__proto__.__proto__ === Object.prototype //true
)
Description:
Number.prototype
is the-generic-object, of all numbers.
In other words, its members are-inherited by all numbers.
Name:
* cpt.ljso.Number.prototype,
* cpt.ljs'Number.prototype,
* cpt.ljsNumber.prototype,
* cpt.ljsNumber.prototype-object,
Generic-chain:
* Object.prototype (Number.prototype.__proto__ === Object.prototype //true
),
Member:
(Node.6.3.0):
> Object.getOwnPropertyNames(Number.prototype).sort()
[ 'constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf' ]
(Chrome.50):
> Object.getOwnPropertyNames(Number.prototype).sort()
["constructor", "toExponential", "toFixed", "toLocaleString", "toPrecision", "toString", "valueOf"]
(Firefox.46):
> Object.getOwnPropertyNames(Number.prototype).sort()
["constructor", "toExponential", "toFixed", "toLocaleString", "toPrecision", "toSource", "toString", "valueOf"]
(Edge.20):
> Object.getOwnPropertyNames(Number.prototype).sort()
[constructor", "toExponential", "toFixed", "toLocaleString", "toPrecision", "toString", "valueOf"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Number.prototype).sort()
["constructor", "toExponential", "toFixed", "toLocaleString", "toPrecision", "toString", "valueOf"]
Description:
Object is a-collection of name-value-pairs, which inherits the-members of the-Object.prototype
, in other words it is SPECIFIC of the-Object.prototype
.
Objects are semantic-units that map concepts.
The famous sentence 'everything is an object', is wrong because there are and no-objects.
The correct sentence is: 'almost everything is an-Object.prototype'.
Name:
* cpt.ljs'object,
* cpt.ljsobject,
* cpt.ljso,
* ljsobject-cpt,
* ljso-cpt,
Whole-chain:
=== (syntax-wptree)
* ljs-phrase,
* ljs-sentence,
* ljs-library,
* ljs-program,
=== (API-wptree)
* another semantic-unit,
...
* window,
Generic-chain:
A-generic-object inherits its members to its specifics.
===
* Object.prototype, (literal-objects ({}).__proto__ === Object.prototype //true
)
or
* Constructor.prototype, (constructor-objects)
or
* objectX, (var o = Object.create(objectX)
)
Description:
Members are-called the-name-value-pairs of an-object.
Name:
* cpt.ljs'object's-member,
* cpt.ljs'object'member,
* cpt.ljsobject's-member,
* cpt.ljsombr,
* Some call the-members 'properties', and some with 'properties' the non-methods members.
Creating:
a) with the-creation of the-object.
b) after object creation with the-code:
object.member = value;
Access:
To access a-member of an-object, ljs uses the-code:
object.member or
object[member]
Specific:
* Inherited: a-member of its generic-objects.
* InheritedNo,
* Method: a-member which is a-function.
* MethodNo: any other member. Some call them 'properties'.
Specific.alphabetically:
* constructor-object,
* constructorNo-object,
* custom-object,
* customNo-object,
* first-class-object,
* first-class-no-object,
* literal-object,
* literalNo-object,
* most-generic-object,
* most-whole-object,
Description:
Constructor-object is an-object created with a-constructor-function: var o = new Constructor();
Name:
* cpt.ljs'constructor-object,
* cpt.ljsconstructor-object,
* cpt.ljs'object.constructor,
* cpt.ljsobject.constructor,
* cpt.ljs'object-created-by-a-constructor,
* cpt.ljsobject-created-by-a-constructor,
* cpt.ljso.constructor,
===
I use to name individual constructor-objecs as: oConstructor
which helps reading the-code.
Generic-chain:
* Constructor.prototype,
...
* Object.prototype,
Member:
A-constructor-object has as members the-nvps of its constructor that are-prefixed with this
.
Also it inherits the-members of the-Constructor.prototype-object.
Description:
ConstructorNo-object is an-object NOT-CREATED with a-constructor-function: var o = new Constructor();
There are 3 cases:
a) a-literal-object.
b) var o = Object.create(o2);
Here, o2 is a-generic of o.
c) object created as a return of a-function.
Name:
* cpt.ljs'constructorNo-object,
* cpt.ljsconstructorNo-object,
* cpt.ljs'nonconstructor-object,
* cpt.ljsnonconstructor-object,
* cpt.ljs'object.constructorNo,
* cpt.ljsobject.constructorNo,
* cpt.ljs'object-not-created-by-a-constructor,
* cpt.ljsobject-not-created-by-a-constructor,
* cpt.ljso.constructorNo,
Description:
First-class-object is an-object which can-have members.
[https://developer.mozilla.org/en-US/docs/Web/javascript/Reference/Functions]
Name:
* cpt.ljs'first-class-object,
* cpt.ljsfirst-class-object,
* cpt.ljs'firstclass-object,
* cpt.ljsfirstclass-object,
* cpt.ljs'object.first-class,
* cpt.ljsobject.first-class,
* cpt.ljso.first-class,
Specific:
* array,
* function,
* regexp,
* number-non-literal, (var n = new Number(2)
)
* string-non-literal, (var s = new String('string')
)
Description:
First-class-no- object is an-object which can-NOT-have members.
[https://developer.mozilla.org/en-US/docs/Web/javascript/Reference/Functions]
Name:
* cpt.ljs'first-class-object.no,
* cpt.ljsfirst-class-object.no,
* cpt.ljs'firstclass-object.no,
* cpt.ljsfirstclass-object.no,
* cpt.ljs'object.first-class.no,
* cpt.ljsobject.first-class.no,
* cpt.ljso.first-class.no,
Specific:
* boolean,
* number-literal, (var n = 2
)
* string-literal, (var s = 'string'
)
Description:
Literal-object is an-object created directly by the-programer.
Code:
var o = {
a: [1, 's'],
b: true,
f: function(){},
n: 2,
o2: {n:1, s:'s'},
r: /d/,
s: 'string',
}
Name:
* cpt.ljs'literal-object,
* cpt.ljsliteral-object,
* cpt.ljs'object.literal,
* cpt.ljsobject.literal,
Generic-chain:
* Object.prototype,
Description:
LiteralNo-object is an-object NOT created directly by the-programer.
Name:
* cpt.ljs'non-literal-object,
* cpt.ljsnon-literal-object,
* cpt.ljs'literalNo-object,
* cpt.ljsliteralNo-object,
* cpt.ljs'object.literalNo,
* cpt.ljsobject.literalNo,
Specific:
* constructor-object,
* var o = Object.create(o2);
* object created as a return of a-function.
Description:
RegExp (regular-expression) denotes parts of texts.
They are the-query-language for texts in archetype.
Code-example:
var r = /d/;
Name:
* cpt.ljs'regexp,
* cpt.ljsregexp,
* cpt.ljsr,
* ljsregexp-cpt,
* ljsr-cpt,
Generic-chain:
* RegExp.prototype, (/r/.__proto__ === RegExp.prototype //true
)
* Object.prototype, (/r/.__proto__.__proto__ === Object.prototype //true
)
Description:
RegExp.prototype
is the-generic-object, of all regexp.
In other words, its members are-inherited by all regexp.
Name:
* cpt.ljso.RegExp.prototype,
* cpt.ljs'RegExp.prototype,
* cpt.ljs'RegExp.prototype,
* cpt.ljsRegExp.prototype,
* cpt.ljsRegExp.prototype-object,
Generic-chain:
* Object.prototype (RegExp.prototype.__proto__ === Object.prototype //true
),
Member:
(Chrome.50):
> Object.getOwnPropertyNames(RegExp.prototype).sort()
["compile", "constructor", "exec", "flags", "global", "ignoreCase", "multiline", "source", "sticky", "test", "toString", "unicode"]
(Firefox.46):
> Object.getOwnPropertyNames(RegExp.prototype).sort()
["compile", "constructor", "exec", "flags", "global", "ignoreCase", "lastIndex", "multiline", "source", "sticky", "test", "toSource", "toString", "unicode"]
(Edge.20):
> Object.getOwnPropertyNames(RegExp.prototype).sort()
["compile", "constructor", "exec", "global", "ignoreCase", "lastIndex", "multiline", "options", "source", "test", "toString", "unicode"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(RegExp.prototype).sort()
["compile", "constructor", "exec", "global", "ignoreCase", "lastIndex", "multiline", "source", "test", "toString"]
Description:
Strings represent any text in archetype.
Strings have meaning for humans, but NOT for the-machines.
Code-example:
var s = 'string';
Name:
* cpt.ljs'string,
* cpt.ljsstring,
* cpt.ljss,
* ljsstring-cpt,
* ljss-cpt,
Generic-chain:
* String.prototype, (''.__proto__ === String.prototype //true
)
* Object.prototype, (''.__proto__.__proto__ === Object.prototype //true
)
Description:
String.prototype
is the-generic-object, of all strings.
In other words, its members are-inherited by all strings.
Name:
* cpt.ljso.String.prototype,
* cpt.ljs'String.prototype,
* cpt.ljsString.prototype,
* cpt.ljsString.prototype-object,
Generic-chain:
* Object.prototype (String.prototype.__proto__ === Object.prototype //true
),
Member:
(Node.6.3.0):
> Object.getOwnPropertyNames(String.prototype).sort()
[ 'anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'normalize', 'repeat', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf' ]
(Chrome.50):
> Object.getOwnPropertyNames(String.prototype).sort()
["anchor", "big", "blink", "bold", "charAt", "charCodeAt", "codePointAt", "concat", "constructor", "endsWith", "fixed", "fontcolor", "fontsize", "includes", "indexOf", "italics", "lastIndexOf", "length", "link", "localeCompare", "match", "normalize", "repeat", "replace", "search", "slice", "small", "split", "startsWith", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toString", "toUpperCase", "trim", "trimLeft", "trimRight", "valueOf"]
(Firefox.46):
> Object.getOwnPropertyNames(String.prototype).sort()
["anchor", "big", "blink", "bold", "charAt", "charCodeAt", "codePointAt", "concat", "constructor", "contains", "endsWith", "fixed", "fontcolor", "fontsize", "includes", "indexOf", "italics", "lastIndexOf", "length", "link", "localeCompare", "match", "normalize", "repeat", "replace", "search", "slice", "small", "split", "startsWith", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toSource", "toString", "toUpperCase", "trim", "trimLeft", "trimRight", "valueOf"]
(Edge.20):
> Object.getOwnPropertyNames(String.prototype).sort()
["anchor", "big", "blink", "bold", "charAt", "charCodeAt", "codePointAt", "concat", "constructor", "endsWith", "fixed", "fontcolor", "fontsize", "includes", "indexOf", "italics", "lastIndexOf", "length", "link", "localeCompare", "match", "normalize", "repeat", "replace", "search", "slice", "small", "split", "startsWith", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toString", "toUpperCase", "trim", "trimLeft", "trimRight", "valueOf"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(String.prototype).sort()
["anchor", "big", "blink", "bold", "charAt", "charCodeAt", "concat", "constructor", "fixed", "fontcolor", "fontsize", "indexOf", "italics", "lastIndexOf", "length", "link", "localeCompare", "match", "replace", "search", "slice", "small", "split", "strike", "sub", "substr", "substring", "sup", "toLocaleLowerCase", "toLocaleUpperCase", "toLowerCase", "toString", "toUpperCase", "trim", "trimLeft", "trimRight", "valueOf"]
Description:
Undefined is a-semantic-unit that denotes a-name-value-pair without value assigned (initialized).
Also it is-used to denote that a-function has no output.
Code: undefined
Name:
* cpt.ljs'undefined,
* cpt.ljsundefined,
* cpt.ljsu,
* ljsundefined-cpt,
* ljsu-cpt,
Generic-chain:
* objectNo,
* semantic-unit,
Description:
In order to create combinations of semantic-units we need to give names to semantic-units and combinations of semantic-units.
This pair of a-name and the-information associated with this name is the-name-value-pair (variable).
Name:
* cpt.ljs'name-value-pair,
* cpt.ljsname-value-pair,
* cpt.ljs'variable,
* cpt.ljsvariable,
* ljsname-value-pair,
* cpt.ljs'nvp,
* cpt.ljsnvp,
* cpt.ljsv,
Generic-chain:
* the-generic of its value.
Description:
The-name of a-name-value-pair is-called idenfier.
An-identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9).
Name:
* cpt.ljs'identifier,
* cpt.ljsidentifier,
Typename|Valuename:
Since {2014.08.05} I am-using typenames in my code, which makes the-code much more readable.
Description:
The-information we assign in the-name of a-name-value-pair is-called value.
Specific:
* const-nvp,
* let-nvp,
* var-nvp,
===
* mixed-nvp,
* mixedNo-nvp,
Specific:
* mixed-name-value-pair--semantic-unit,
* mixedNo-name-value-pair--semantic-unit,
MixedNo-name-value-pair--semantic-unit:
Description:
MixedNo-name-value-pair is a-name-value-pair which ASSOCIATES only ONE type of value with a-name.
Name:
* cpt.ljs'mixedNo-semantic-unit,
* cpt.ljsmixedNo-semantic-unit,
* cpt.ljs'mixedNo-name-value-pair--semantic-unit,
* cpt.ljsmixedNo-name-value-pair--semantic-unit,
* cpt.ljs'mixedNo,
* cpt.ljsmixedNo,
Description:
The const
declaration creates a read-only reference to a value.
It does not mean the value it holds is immutable, just that the variable identifier cannot be reassigned.
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/const]
Name:
* cpt.ljs'const-name-value-pair,
* cpt.ljsconst-name-value-pair,
* cpt.ljs'constant,
* cpt.ljs'const,
* cpt.ljsconst,
Description:
The let statement declares a block scope local variable, optionally initializing it to a value.
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/let]
Name:
* cpt.ljs'let-name-value-pair,
* cpt.ljslet-name-value-pair,
* cpt.ljs'let,
* cpt.ljslet,
Description:
The scope of a variable declared with var
is its current execution context, which is either the enclosing function or, for variables declared outside any function, global.
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/var]
Name:
* cpt.ljs'var-name-value-pair,
* cpt.ljsvar-name-value-pair,
* cpt.ljs'var,
* cpt.ljsvar,
Description:
Mixed is a-name-value-pair that contains different semantic-units.
Name:
* cpt.ljs'mixed,
* cpt.ljs'mixed-semantic-unit,
* cpt.ljsmixed,
* cpt.ljsx,
* ljsmixed-cpt,
* ljsx-cpt,
Description:
API is a-set of semantic-units.
An-API, like any conceptual-information, is-structured at the SAME time, into 2 different tree-structures:
1) A-whole-part-tree with root-node the-most-whole-object and
2) A-generic-specific-tree with root-node the-most-generic-object (Object.prototype
).
The-discovery (not invention) that an-API has 2 different tree-structures, is mine which I first discovered to have any human-conceptual-information.
Name:
* cpt.ljs'API,
* cpt.ljs'Application-Programming-Interface,
* cpt.ljs'Application-Programing-Interface,
* cpt.ljsapi,
* API-cpt,
Description:
The whole-part relations of semantic-units form a whole-part-tree structure.
The-ROOT-node of this structure is the most-whole-object and contains all others.
It is called the-global-object.
With the same name are-called and its children (not its descendants).
In ljb, this is the-window
-object.
In ljn, this is the-global
-object.
Name:
* cpt.ljs'most-whole-object,
* cpt.ljs'global-object,
* cpt.ljsmost-whole-object,
* cpt.ljsmwo,
* most-whole-object-cpt,
Generic-chain:
...
* Object.prototype,
LOOK-THAT: the-most-whole-object is specific of the-most-generic-object.
Description:
The-members of the-most-whole-object are-called ALSO 'globals'.
To avoid ambiguity I will-call them 'global-members'.
Name:
* cpt.ljs'global-member,
* cpt.ljs'global,
* cpt.ljs'globals,
* cpt.ljs'member-of-most-whole-object,
* cpt.ljsglobal,
Specific:
* ljb-global-member,
* ljn-global-member,
Description:
All ljs-objects inherit the-members of this object.
Object.prototype is the-ROOT node of the-API-generic-specific-tree of ALL javascript dialects.
Name:
* cpt.ljs'Object.prototype,
* cpt.ljsObject.prototype,
* ljsObject.prototype-cpt,
* Object.prototype-cpt,
Whole-chain:
* Object,
* most-whole-object,
LOOK-THAT: the-most-generic-object is part of the-Object-function, which is part of the-most-whole-object.
Member:
(ljn.6-3-1)
> Object.getOwnPropertyNames(Object.prototype).sort()
[ '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', '__proto__', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]
(Chrome.50):
> Object.getOwnPropertyNames(Object.prototype).sort()
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]
(Firefox.46):
> Object.getOwnPropertyNames(Object.prototype).sort()
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toSource", "toString", "unwatch", "valueOf", "watch"]
(Edge.20):
> Object.getOwnPropertyNames(Object.prototype).sort()
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Object.prototype).sort()
["__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__", "constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]
Specific:
* ljb-Object.prototype,
* ljn-ljsObject.prototype,
Description:
Object
is the-constructor that contains the-Object.prototype.
It can-create objects: var s = new Object('string');
It contains important names.
Name:
* cpt.ljs'Object,
* cpt.ljs'Object-function,
* cpt.ljsObject,
Whole-chain:
* most-whole-object,
Generic-chain:
* Function.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Object).sort()
["arguments", "assign", "caller", "create", "defineProperties", "defineProperty", "freeze", "getOwnPropertyDescriptor", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "is", "isExtensible", "isFrozen", "isSealed", "keys", "length", "name", "preventExtensions", "prototype", "seal", "setPrototypeOf"]
(Firefox.46):
> Object.getOwnPropertyNames(Object).sort()
[]
(Edge.20):
> Object.getOwnPropertyNames(Object).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Object).sort()
[]
Description:
The-semantic-units of an-api form a-whole-part-tree.
The-ROOT-node of this structure is the-most-whole-object (the-global-object) and contains all others.
Name:
* cpt.ljs'api-whole-part-tree,
* cpt.ljs'whole-part-tree-of-api,
* cpt.ljs'wpt,
* cpt.ljswpt,
Specific:
* ljb-native-whole-part-tree,
* ljn-native-whole-part-tree,
Description:
The-semantic-units of an-api except of a-whole-part-tree form AND a-generic-specific-tree.
The-ROOT-node of this structure is the-most-generic-object, the-Object.prototype
.
Name:
* cpt.ljs'api-generic-specific-tree,
* cpt.ljs'generic-specific-tree-of-api,
Specific:
* ljb-native-generic-specific-tree,
* ljn-native-generic-specific-tree,
Specific:
* ljb-API,
* ljn-API,
===
* native-API,
* nativeNo-API,
===
* vanilla-API,
* vanillaNo-API,
===
* library-API,
* program-API,
Descripton:
Vanilla-API is an-API with only native-semantic-units and custom-semantic-units created in one algorithm (no external libraries).
Name:
* cpt.ljs'API.vanilla,
* cpt.ljs'vanilla-API,
* cpt.ljs'plain-API,
Descripton:
Native-API is the-API with only and all the-native-semantic-units.
It has a-whole-part-tree-structure AND a-generic-specific-tree-structure.
Name:
* cpt.ljs'API.native,
* cpt.ljs'native-API,
* cpt.ljs'builtin-API,
Generic:
* ljs-API,
Specific:
* ljb-native-API,
* ljn-native-API,
Description.short:
The Error constructor creates an error object. Instances of Error objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions. See below for standard built-in error types.
Syntax
new Error([message[, fileName[, lineNumber]]])
[https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Error]
Name:
* cpt.ljs'Error-function,
* cpt.ljsError-function,
* cpt.ljs'Error,
* cpt.ljsError,
* Error-cpt,
* Error-function-cpt,
Description:
All JavaScript and System errors raised by Node.js inherit from, or are instances of, the standard JavaScript Error
class and are guaranteed to provide at least the properties available on that class.
[https://nodejs.org/docs/v6.3.1/api/errors.html#errors_errors]
Member:
// ljn.6-3-1
// Object.getOwnPropertyNames(Error).sort()
[ 'arguments', 'caller', 'captureStackTrace', 'length', 'name', 'prototype', 'stackTraceLimit' ]
===
// Chrome.52
// Object.getOwnPropertyNames(Error).sort()
["arguments", "caller", "captureStackTrace", "length", "name", "prototype", "stackTraceLimit"]
===
// Firefox.47
// Object.getOwnPropertyNames(Error).sort()
[ "length", "name", "prototype" ]
===
// Edge.25
// Object.getOwnPropertyNames(Error).sort()
["arguments", "caller", length", "name", "prototype", "stackTraceLimit"]
Resource:
* https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Error,
* https://nodejs.org/api/errors.html,
Name:
* cpt.ljs'Math,
* cpt.ljsMath,
* cpt.ljs'Math-object,
* cpt.ljsMath-object,
* cpt.ljso.Math,
* Math-cpt,
* oMath-cpt,
Whole-chain:
* ljs-most-whole-object (global),
ljsMath'Member:
(ljn.6-2-2)
> Object.getOwnPropertyNames(Math).sort()
[ 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2', 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'clz32', 'cos', 'cosh', 'exp', 'expm1', 'floor', 'fround', 'hypot', 'imul', 'log', 'log10', 'log1p', 'log2', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc' ]
(Firefox.47)
> Object.getOwnPropertyNames(Math).sort()
[ 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2', 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'clz32', 'cos', 'cosh', 'exp', 'expm1', 'floor', 'fround', 'hypot', 'imul', 'log', 'log10', 'log1p', 'log2', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'toSource', 'trunc' ]
(Edge.25)
> Object.getOwnPropertyNames(Math).sort()
[ 'E', 'LN10', 'LN2', 'LOG10E', 'LOG2E', 'PI', 'SQRT1_2', 'SQRT2', 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'cbrt', 'ceil', 'clz32', 'cos', 'cosh', 'exp', 'expm1', 'floor', 'fround', 'hypot', 'imul', 'log', 'log10', 'log1p', 'log2', 'max', 'min', 'pow', 'random', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc' ]
Description:
The decodeURI() function decodes a Uniform Resource Identifier (URI) previously created by encodeURI or by a similar routine.
Syntax
decodeURI(encodedURI)
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI]
Name:
* cpt.ljs'decodeURI,
* cpt.ljsdecodeURI,
* cpt.ljs'decodeURI-function,
Code.ljs:
> decodeURI('https://el.wikipedia.org/wiki/%CE%91%CE%BB%CE%AD%CE%BA%CE%BF%CF%82_%CE%86%CF%87%CE%BF%CE%BB%CE%BF%CF%82')
< "https://el.wikipedia.org/wiki/Αλέκος_Άχολος"
Description:
Phrases[1] are whole-constructs of semantic-unit NAMES to denote relations of their archetypes that[1] cannot exists autonomously inside the-algorithm.
Name:
* cpt.ljs'phrase,
* cpt.ljsphrase,
* cpt.ljs'semantic-unit-structures,
* cpt.ljssemantic-unit-structures,
* cpt.ljs'sus,
* cpt.ljssus,
Whole-chain:
* ljs-sentence,
Part:
* ljs-semantic-unit,
Description:
Code-phrase is a-phrase written in code-format.
Examples:
o.member
a[3]
2 + 3
if (b)
Name:
* cpt.ljs'phrase.code,
* cpt.ljsphrase.code,
* cpt.ljs'code-phrase,
* cpt.ljscode-phrase,
Description:
Sentences are whole-constructs of semantic-units, ljs-phrases and even other sentences that exists autonomously inside the-algorithm.
The-algorithm is a-whole-part-tree structure of sentences.
Name:
* cpt.ljs'sentence,
* cpt.ljssentence,
* cpt.ljs'statement,
* cpt.ljsstatement,
Whole-chain:
* ljs-program,
Part:
* ljs-ljs-phrase,
* ljs-semantic-unit,
Description:
Code-sentence is a-sentence written in code-format.
Example:
var s = 'string';
n = 2 + 3;
if (b) {//do this};
Name:
* cpt.ljs'sentence.code,
* cpt.ljssentence.code,
* cpt.ljs'code-sentence,
* cpt.ljscode-sentence,
SPECIFIC.alphabetically:
* assignment-sentence,
* block-sentence,
* break-sentence,
* creation-sentence,
* conditional-sentence,
* continue-sentence,
* control-sentence,
* definition-sentence,
* delete-sentence,
* do-while-sentence,
* for-sentence,
* generic-sentence,
* genericNo-sentence,
* if-sentence,
* Immediately-invoked-function-expression,
* instance-sentence,
* instanceNo-sentence,
* label-sentence,
* loop-sentence,
* return-sentence,
* simple-sentence,
* simpleNo-sentence,
* switch-sentence,
* while-sentence,
SPECIFIC_DIVISION.instance:
* instance-sentence (genericNo): has no specifics,
* instanceNo-sentence (generic),
SPECIFIC_DIVISION.simple:
* simple-sentence: denotes one relation or doing,
* simpleNo-sentence,
Description:
Assignment-sentence is a-sentence that puts|assigns a-value in a-name-value-pair.
Code:
n = 3;
s = "text";
Name:
* cpt.ljs'assignment-sentence,
* cpt.ljsassignment-sentence,
* cpt.ljs'assignment-statement,
* cpt.ljsassignment-statement,
Description:
Block-sentence is a-sentence that contains an-order-set of other sentences.
Code:
{
sentence1;
sentence2;
...
}
Name:
* cpt.ljs'block-sentence,
* cpt.ljsblock-sentence,
* cpt.ljs'block-statement,
* cpt.ljsblock-statement,
Description:
Definitions are sentences that create instances of semantic-units.
In contrast to natural-languages, machines throw errors if a-sentence uses an undefined semantic-unit!!!
Name:
* cpt.ljs'definition-sentence,
* cpt.ljsdefinition-sentence,
* cpt.ljs'definition-statement,
* cpt.ljsdefinition-statement,
* cpt.ljs'declaration,
* cpt.ljsdeclaration,
Specific:
* function-definition,
* name-value-pair definition,
Description:
A-sentence that creates function instance.
Code:
function fName(input-variables) {
//function body
}
Name:
* cpt.ljs'function-definition-sentence,
* cpt.ljsfunction-definition-sentence,
* cpt.ljs'definition.function,
* cpt.ljsdefinition.function,
* cpt.ljs'function-declaration,
* cpt.ljsfunction-declaration,
Description:
A-sentence that creates a-name-value-pair instance.
Code:
var name;
// === number nvp definition and assignment
var n = 3;
===
const n = 3;
===
let n = 3;
Name:
* cpt.ljs'name-value-pair-definition,
* cpt.ljsname-value-pair-definition,
* cpt.ljs'variable-statement,
* cpt.ljsvariable-statement,
* cpt.ljs'variable-definition-sentence,
* cpt.ljsvariable-definition-sentence,
* cpt.ljs'definition.variable,
* cpt.ljsdefinition.variable,
* cpt.ljs'variable-declaration,
* cpt.ljsvariable-declaration,
Description:
Algo-root-tree is the OUTERMOST TREE of an-algorithm, in a-webpage.
Name:
* cpt.ljs'algo-root-tree,
* cpt.ljsalgo-root-tree,
* cpt.ljs-algo-root,
Description:
With the-language programers create many algorithms.
The-quantity depends on the-archetypes known, and the-semantic-units of the-language.
Specific:
* Browser-management,
* Codomain,
* Event-management,
* HML-management,
* Library,
* Math-management,
* Program,
* Time-management,
Description:
An-algorithm is an-INSTANCE of communication.
The-set of all algorithms is the-codomain of the-language.
Name:
* cpt.ljs'codomain,
* cpt.ljscodomain,
* cpt.ljs'domainOut,
* cpt.ljsdomainOut,
* ljscodomain,
* ljscodomainOut,
Description:
Algo-library is an-algorithm which can-not-RUN autonomously, but inside another algo.
In other words, a-library HAS-NO an-executing-entry-point, like a-program.
A-library is a-container of NEW semantic-units and so has an-API.
Name:
* cpt.ljs'library,
* cpt.ljs'framework,
* cpt.ljs'plugin,
* cpt.ljslibrary,
* cpt.ljsframework,
* cpt.ljsplugin,
* cpt.ljslbr,
* cpt.ljs'algo.library,
* cpt.ljsalgo.library,
* cpt.ljs-algo-library,
* ljs'library-cpt,
Whole-chain:
* ljs-program,
Part:
* ljs-sentence,
Description:
In ljb you use the-hml-element script
.
In ljn with require()
because a-library is a-module.
Specific:
* ljb-library,
* ljn-library,
===
* vanilla-library,
* vanillaNo-library,
Description:
Vanilla-library is a-library that uses ONLY native-API.
Name:
* cpt.ljs'vanilla-library,
* cpt.ljs'library.vanilla,
* cpt.vanilla-library,
* vanilla-library-cpt,
Description:
Ljs-program is an-algorithm which can-RUN autonomously, written in code-format.
In other words, a-program HAS an-executing-entry-point.
A-program is a-container of NEW semantic-units and so has an-API.
Name:
* cpt.ljs'algo-program,
* cpt.ljsalgo-program,
* cpt.ljs-algo-program,
* cpt.ljs'program,
* cpt.ljsprogram,
* ljsprogram-cpt,
Part:
* ljs-library,
* ljs-sentence,
Description:
Ljs-program-execution is the-process of commanding it to work.
Ljb and ljn programs are-executed very differently.
Name:
* cpt.ljs'program'execution,
* cpt.ljsprogram'execution,
* cpt.ljspgm'call,
* cpt.ljspgm'execution,
* cpt.ljspgm'invocation,
* cpt.ljspgm'open,
* cpt.ljspgm'run,
Specific:
* ljb-program,
* ljn-program,
Description:
The-code is understood by machines indirectly.
Machines directly understand only binary-information.
Therefore, the-code is-translated (with programs) in a-binary-format (binary-code) inside the-machine in order to be-executed.
Name:
* cpt.ljs'binary-code,
* cpt.ljsbinary-code,
* cpt.ljsbcode,
Name:
* cpt.ljs'evaluation,
* cpt.ljsevaluation,
Its code is-created FROM only 12 semantic-units.
Javascript-objects do-not-inherit members from other special constructs like 'classes' (like java), but just from other objects.
This simple and powerful characteristic, called 'prototype-based-inheritance' confused programers who knew 'class-based-inheritance'.
Another cause of this confusion is the incorrect use of 'instanceof' by the-language designers.
Also constructor-functions mimic classes, especially with the-new-operator.
I have-created a full desktop browser program, which does-NOT-use a-single custom-constructor!!!
ECMAScript.6.2015 decision to add and classes, is wrong, because it creates an EXTRA semantic-unit, the-class, to implement inheritance[1] which[1] is already implemented with the-prototype-system.
Node.js implementation of 'classes' is-done by creating special functions.
Today builtin identifiers do-not-convey information about their values.
Since {2014.08.05}, I am-using valuenames in my code, which makes the-code much more readable.
Also this way we can-have type checking at write-time.
Description:
'Instance' is a-specific-concept with no more specifics.
'My-car' is an-instance of 'car'.
Ljs-objects-created-from-constructors ARE NOT INSTANCES of their constructor.
They are instances of the-Constructor.prototype-object.
THEN the-instanceof operator is a design name-mistake of javascript.
The-confusion came from class-based-languages where the-objects are indeed instances of classes.
objectof
is a better name.
[https://twitter.com/BrendanEich/status/734118379036934144]
Today, ljs, has only 'function-scope'.
This means, that a-name-value-pair defined inside a-function, can be used all over inside this function.
In other names, the-members of a-function see each other.
We do-not-have this feature inside objects, and to overcome it, we use constructors, or object-returning-functions.
Code-example:
var o = {n1:1, n2:n1} //throws Uncaught ReferenceError
var f=function(){var n1=1; var n2=n1;} //no Error
In my opinion ljs needs:
1) Valuenames.
2) Object-scope.
3) No constructors.
Objects could-be-created by functions like Object.create()
, functions returning objects, and literal-objects.
The-generic-chain to be: object > objectSpc > objectSpc > ...
And NOT: Object.prototype > Constructor.prototype > Constructor.prototype ...
Description:
Any human related to the-language.
Name:
* cpt.ljs'human,
* cpt.ljshuman,
* cpt.ljshmn,
Description:
Creator is any human who contributed in the-creation of the-language.
Name:
* cpt.ljs'creator,
* cpt.ljscreator,
Specific:
* Designer: the-human who created the-spec of the-language,
* Implementor: the-human who created the-code to binary-code translator,
Description:
Programer is a-human who creates programs.
Name:
* cpt.ljs'programer,
* cpt.ljsprogramer,
* cpt.ljspmr,
Description:
User is a-human who uses|runs a-program.
Description:
My goal to write this page, is to help the-learning of the-language from a-linguistic perspective.
My second innovation is the-representation of the-subject.
I am-not-writing down a-bla-bla-text describing the-subject, repeating characteristics here and there.
I am-writing STRUCTURED-CONCEPTS in ONE format.
You can-read the-concept of javascript sequentially OR you can-search for a-characteristic and from there to reach any related concept.
Name:
cpt.ljs'learning,
cpt.ljslearning,
Resource:
* https://developer.mozilla.org/en-US/Learn/JavaScript,
* https://www.codementor.io/learn-javascript-online,
Specific:
* learning-browser-javascript,
* learning-Node-javascript,
Description:
Specification is a-text-document that describes|defines a-language.
ECMA-International creates the-specs for ljb.
ECMA-International creates many standards.
ECMA-262 is the-standard that defines the-ECMAScript-language, as it calls the-ljb.
Specs are-published in pdf or HML format and are texts hard to read and multisemantic.
In current webpage-concept I TRY to describe the-language in monosemantic English by defining most of the-names of my sentences.
Name:
cpt.ECMAScript,
cpt.ljs'specification,
cpt.ljsspecification,
cpt.ljs'spec,
cpt.ljsspec,
cpt.lje,
Specific (versions):
* ECMAScript.6.2015,
* ECMAScript.51.2011,
* ECMAScript.5.1999,
* ECMAScript.4 not existing,
* ECMAScript.3.1999,
* ECMAScript.2.1998,
* ECMAScript.1.1997,
Description:
ECMAScript-2015 (6th edition) is the latest version.
Pdf-version.
HML-version.
Name:
* cpt.lje.6.2015,
* cpt.lje.2015.6,
* cpt.ES2015,
* cpt.ECMAScript.6.2015,
* cpt.ECMAScript-2015,
* cpt.ECMA-262-6th-edition,
* cpt.Standard-ECMA-262-6th-edition,
Compatibility:
* compatibility-table, Created by kangax.
* node.green, Node.js compatibility-table, Created by William-Kapke.
Description:
ECMAScript-5.1 is the-version previous to ECMAScript.6.2015, approved on {2011.June}.
My html5.id.toc.preview-version.
Pdf-version.
HML-version.
Name:
* cpt.lje.51.2011,
* cpt.lje.2011.51,
* cpt.ECMAScript.51.2011,
* cpt.ECMAScript-5.1,
* cpt.ECMA-262-5.1-edition,
* cpt.Standard-ECMA-262-5.1-edition,
Description:
Any program, used to work with the-language, write, execute, debug, analyze, test the-code.
Name:
* cpt.ljs'development-tool,
* cpt.ljs'programing-tool,
* cpt.ljs'tool,
* cpt.ljstool,
Specific:
* build-tool,
* code-analysis-tool,
* debugger-tool,
* editor-tool,
* interpreter-(runtime)-tool,
* testing-tool,
===
* ljb-tool,
* ljn-tool,
Description:
A JavaScript engine is a program or library which executes JavaScript code.
A JavaScript engine may be a traditional interpreter, or it may utilize just-in-time compilation to bytecode in some manner.
Although there are several uses for a JavaScript engine, it is most commonly used in web browsers.
[https://en.wikipedia.org/wiki/JavaScript_engine {2016.07.25}]
Name:
* cpt.ljs'tool.engine,
* cpt.ljs'ljs-engine,
* cpt.ljs'ljs-interpreter,
* cpt.ljs'ljs-runtime,
* cpt.ljs'javascript-engine,
Specific:
* browser-engine,
* browserNo-engine,
* Node.js-engine,
* Google-V8-engine,
Description:
V8 is Google's open source high-performance JavaScript engine, written in C++ and used in Google Chrome, the open source browser from Google.
It implements ECMAScript as specified in ECMA-262, and runs on Windows XP or later, Mac OS X 10.5+, and Linux systems that use IA-32, ARM or MIPS processors.
V8 can run standalone, or can be embedded into any C++ application.
[https://github.com/v8/v8/wiki]
Name:
* cpt.ljs'v8,
* cpt.ljs'Google-V8-engine,
* cpt.ljs'Google-V8-javascript-engine,
Name:
cpt.ljs.specific,
cpt.ljs'dialect,
cpt.ljsdialect,
Description:
A-javascript-dialect is a-programing-language with most of the-characteristics of ljs, that a-programer 'speaks' and a-computer 'understands'.
If there is no a-compiler|interpreter there is no programing-language.
Today our theories about the-languages (human or computer) are incorrect to a significant extent, but the-languages exist before our theories about them.
ECMAScript, from this point of view, is not a-language, it is a-theory about ljs.
Specific:
* Browser-javascript,
* BrowserNo-javascript,
* Node-javascript,
* Server-javascript,
* ServerNo-javascript,
* Strict-javascript,
* StrictNo-javascript,
Description:
Browser-javascript (ljb) is the-programing-language of webpages, the-language which the-web-browsers know, the so called client-side-javascript.
Name:
* cpt.browser-javascript,
* cpt.browser-javascript-language,
* cpt.browser-javascript-programing-language,
* cpt.jsb,
* cpt.langJsb,
* cpt.lngJsb,
* cpt.ljb,
* cpt.language.javascript.browser,
* cpt.programing-language.javascript.browser,
* browser-javascript-cpt,
* cpt.JavaScript,
Generic-chain:
* javascript-programing-language,
* programing-language,
* computer-language,
* mapping-method,
* method,
* info,
* model,
* entity,
Description:
Ljb-archetype is the-information the-ljb maps.
Ljb-archetype is mainly HML and CSS code with which webpages are-created as well numbers and human-text.
Name:
* cpt.ljb'archetype-information,
* cpt.ljbarchetype-information,
* cpt.ljb'archo,
* cpt.ljbarcho,
* cpt.ljb'arc,
* cpt.ljbarc,
Generic-chain:
* ljs-archetype,
Description:
An-archetype is an-INSTANCE of communication.
The-set of all archetypes is the-domain of the-language.
Name:
* cpt.ljb'domain,
* cpt.ljbdomain,
* cpt.ljb'domainIn,
* cpt.ljbdomainIn,
* ljbdomain-cpt,
Generic:
* ljs-algorithm,
Name:
* cpt.ljb'algorithm,
* cpt.ljbalgorithm,
* cpt.ljb'algo,
* cpt.ljbalgo,
* cpt.ljb'model,
* cpt.ljbmodel,
* cpt.ljb'alg,
* cpt.ljbalg,
* cpt.ljb'doc,
* cpt.ljbdoc,
Generic:
* ljs-code,
Name:
* cpt.ljb'code,
* cpt.ljbcode,
* cpt.ljb'code-format,
* cpt.ljb'code-format,
* cpt.ljbsource-code,
* cpt.ljb'cod,
* cpt.ljbcod,
Description:
"Εverything flows", the-language and the-browsers.
We need to know, if the-algorithm we constructed is supported by the-browser we use to execute it.
Name:
* cpt.ljb'browser-compatibility,
* cpt.ljbbrowser-compatibility,
* cpt.ljb'browser-support,
* cpt.ljbbrowser-support,
Generic:
* ljs-unit,
Generic:
* ljs-word,
Generic:
* ljs-semantic-unit,
Name:
* cpt.ljb'semantic-unit,
* cpt.ljbsemantic-unit,
* cpt.ljb'unit.semantic,
* cpt.ljbunit.semantic,
* cpt.ljb'sut,
* cpt.ljbsut,
* cpt.ljb'sunit,
* cpt.ljbsunit,
* cpt.ljb'untSmc,
* cpt.ljbuntSmc,
Whole-chain:
=== (syntax-wptree)
* ljb-phrase,
* ljb-sentence,
* ljb-library,
* ljb-program,
=== (API-wptree)
* another semantic-unit,
...
* window,
Specific:
Ljb uses only 11 semantic-units to create an-algorithm:
01) a - Array,
02) b - Boolean,
03) f - Function,
04) l - nuLl,
05) n - Number,
06) o - Object,
07) r - Regexp,
08) s - String,
09) u - Undefined,
10) v - name-Value-pair,
11) x - miXed,
Specific.alphabetically:
* array--semantic-unit,
* boolean--semantic-unit,
* custom--semantic-unit,
* customNo--semantic-unit,
* function--semantic-unit,
* name-semantic-unit,
* nameNo-semantic-unit,
* name-value-pair-mixed--semantic-unit,
* name-value-pair-mixedNo--semantic-unit,
* name-value-pair-No--semantic-unit,
* null--semantic-unit,
* number--semantic-unit,
* object--semantic-unit,
* objectNo--semantic-unit,
* regexp--semantic-unit,
* string--semantic-unit,
* undefined--semantic-unit,
Generic:
* ljs-array,
Generic:
* ljs-boolean,
Name:
* cpt.ljb'boolean,
* cpt.ljbboolean,
* cpt.ljbb,
* ljbboolean-cpt,
* ljbb-cpt,
Generic:
* ljs-function,
Name:
* cpt.ljb'function,
* cpt.ljbfunction,
* cpt.ljbf,
* ljbfunction-cpt,
* ljbf-cpt,
Specific.alphabetically:
* constructor-function,
* custom-function,
* customNo-function,
* method-function,
* methodNo-function,
* object-returning-function,
* operator-function,
* self-executing-function,
Generic:
* ljs-null,
Name:
* cpt.ljb'null,
* cpt.ljbnull,
* cpt.ljbl,
* ljbnull-cpt,
* ljbl-cpt,
Generic:
* ljs-number,
Name:
* cpt.ljb'number,
* cpt.ljbnumber,
* cpt.ljbn,
* ljbn-cpt,
Generic:
* ljs-object,
Name:
* cpt.ljb'object,
* cpt.ljbobject,
* cpt.ljbo,
* ljbobject-cpt,
* ljbo-cpt,
Specific.alphabetically:
* constructor-object,
* constructorNo-object,
* custom-object,
* customNo-object,
* most-whole-object (global),
* first-class-object,
* first-class-no-object,
* literal-object,
* literalNo-object,
* Object.prototype,
Generic:
* ljs-regexp,
Name:
* cpt.ljb'regexp,
* cpt.ljbregexp,
* cpt.ljbr,
* ljbregexp-cpt,
* ljbr-cpt,
Generic:
* ljs-string,
Name:
* cpt.ljb'string,
* cpt.ljbstring,
* cpt.ljbs,
* ljbstring-cpt,
* ljbs-cpt,
Generic:
* ljs-undefined,
Name:
* cpt.ljb'undefined,
* cpt.ljbundefined,
* cpt.ljbu,
* ljbundefined-cpt,
* ljbu-cpt,
Generic:
* ljs-name-value-pair,
Name:
* cpt.ljb'name-semantic-unit,
* cpt.ljb'named-semantic-unit,
* cpt.ljb'name-value-pair,
* cpt.ljbname-value-pair,
* cpt.ljbnvp,
* cpt.ljb'variable,
* cpt.ljbvariable,
* ljbname-value-pair-cpt,
* ljbvariable-cpt,
Generic:
* ljs-mixed-semantic-unit,
Name:
* cpt.ljb'mixed,
* cpt.ljbmixed,
* cpt.ljbx,
* ljbmixed-cpt,
* ljbx-cpt,
Generic:
* ljs-API,
Name:
* cpt.ljb'API,
* cpt.ljbAPI,
* ljb'API-cpt,
Description:
* whole-part-tree-of-ljb-native-API,
* generic-specific-tree-of-ljb-native-API,
Generic:
* ljs-native-API,
Name:
* cpt.ljb'API.native,
* cpt.ljb'native-API,
Description:
An-API is structured (from one point of view) in a-whole-part tree.
window
is the-most-whole-object, the-root, the-global-object, of the-ljb native-API.
Name:
* cpt.ljb'API's-whole-part-tree,
* cpt.ljbAPI's-whole-part-tree,
* cpt.ljb'object-whole-part-tree,
* cpt.ljbobject-whole-part-tree,
* cpt.ljb'wpt,
* cpt.ljbwpt,
Chrome.50.2016-05-09 native-API-whole-part-tree:
(≅700 semantic-units)
Description:
This is the inheritance tree (= specifics inherit the-members of generics) of the-objects of the-language.
The-Object.prototype is the-most-generic-object in the-API's-generic-specific-tree.
Name:
* cpt.ljb'API's-generic-specific-tree,
* cpt.ljbAPI's-generic-specific-tree,
* cpt.ljb'object-generic-specific-tree,
* cpt.ljbobject-generic-specific-tree,
* cpt.ljb'object-hierarchy,
* cpt.ljbobject-hierarchy,
* cpt.ljb'gst,
* cpt.ljbgst,
Generic-Specific-Tree of ljb-native-API:
Math.__proto__ === Object.prototype //true
)Description:
window
is an-objectof Window
function.
It is the-most-whole object of the-browsers, the-global-object, it includes all other language constructs.
It is the-ROOT of the-API-whole-part-tree.
Name:
* cpt.ljb'window,
* cpt.ljbwindow,
* cpt.ljb'global-object,
* cpt.ljbglobal-object,
* cpt.ljb'most-whole-object,
* cpt.ljbmost-whole-object,
Generic-chain:
* Window.prototype (Window.prototype.isPrototypeOf(window) // true
),
* WindowProperties.prototype (internal in Chrome)
* EventTarget.prototype (Window.prototype.__proto__.__proto__ === EventTarget.prototype // true
),
* Object.prototype,
Generic:
* ljs-phrase,
Name:
* cpt.ljb'phrase,
* cpt.ljbphrase,
* cpt.ljb'semantic-unit-structure,
* cpt.ljbsemantic-unit-structure,
* cpt.ljb'sus,
* cpt.ljbsus,
Generic:
* ljs-sentence,
Name:
* cpt.ljb'sentence,
* cpt.ljbsentence,
* cpt.ljb'statement,
* cpt.ljbstatement,
Description:
Algo-root-tree is the OUTERMOST TREE of an-algorithm, in a-webpage.
Name:
* cpt.ljb'algo-root-tree,
* cpt.ljbalgo-root-tree,
* cpt.ljb-algo-root,
Description:
With the-language programers create many algorithms.
The-quantity depends on the-archetypes known, and the-semantic-units of the-language.
Specific:
* Browser-management,
* Event-management,
* HML-management,
* Math-management,
* Time-management,
Generic:
* ljs-library,
Name:
* cpt.ljb'library,
* cpt.ljb'framework,
* cpt.ljb'plugin,
* cpt.ljb'script,
* cpt.ljblibrary,
* cpt.ljb'lbr,
* cpt.ljblbr,
* ljblibrary-cpt,
Description:
To add a-library in your code, to use its semantic-units (its API), you use the-script HML-element:
<script src="location-of-file"></script>
Then all the-semantic-units of the-library were-added in the-ljb-most-whole-object (global).
It is a good practice, to store the-custom-semantic-units of the-library as part of ONE semantic-unit (usually object).
Specific:
* http://www.javascripting.com/
Description:
JavaScript templating refers to the client side data binding method implemented with the JavaScript language.
This approach became popular thanks to JavaScript's increased use, its increase in client processing capabilities, and the trend to outsource computations to the client's web browser. Popular JavaScript templating libraries are AngularJS, Backbone.js, Ember.js, Handlebars.js, Vue.js and Mustache.js.
A frequent practice is to use double curly brackets (i.e. {{key}}) to call values of the given key from data files, often JSON objects.
[https://en.wikipedia.org/wiki/JavaScript_templating]
Name:
* cpt.ljb'templating-library,
* cpt.javascript-templating-library,
* javascript-templating-library-cpt,
Specific:
* AngularJS,
* Backbone.js,
* Chaplin.js,
* Dust.js,
* Ember.js,
* Handlebars.js,
* HTMLBars,
* KnockoutJS,
* Marko.js,
* Mustache.js,
* React.js,
* Underscore.js,
* Vue.js,
Description:
Ljb-program is an-algorithm which can-run autonomously, written in code-format, in a-webpage.
Name:
* cpt.ljb'algo-program,
* cpt.ljbalgo-program,
* cpt.ljb-algo-program,
* cpt.ljb'program,
* cpt.ljbprogram,
Part:
* ljb-library,
* ljb-sentence,
Description:
You open the-HML-doc (webpage) in a-webbrowser which contains it.
Name:
* cpt.ljb'program'execution,
* cpt.ljbprogram'execution,
* cpt.ljbpgm'call,
* cpt.ljbpgm'execution,
* cpt.ljbpgm'invocation,
* cpt.ljbpgm'open,
* cpt.ljbpgm'run,
Description:
This is the classic simplest program that displays the-text 'Hello World'.
You can-open it from this link.
Code:
<!DOCTYPE html>
<html>
<head>
<title>ljbpgm.Hello_World</title>
</head>
<body>
<script>
alert('Hello World!');
</script>
</body>
</html>
Name:
* cpt.ljb'program.Hello-World!,
* cpt.ljbprogram.Hello-World!,
* cpt.ljbpgm.Hello-World!,
Description:
Browser-management is the-algorithm dealing with the-browser, which is the host environment for ljb.
Name:
* cpt.ljb'browser-management,
* cpt.ljbbrowser-management,
* cpt.ljb'browser-manipulation,
* cpt.ljb'browser-manipulation,
* cpt.ljbbrowser-processing,
* cpt.ljb'algBsr,
* cpt.ljbalgBsr,
Whole-part-tree:
Description:
Window
is the-constructor of window
(window.constructor //function Window() { [native code] }
).
Name:
* cpt.ljb'Window,
* cpt.ljbWindow,
* cpt.ljb'Window-function,
* cpt.ljbWindow-function,
Whole-chain:
* window,
Generic-chain:
* EventTarget,
* Function.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Window).sort()
["PERSISTENT", "TEMPORARY", "arguments", "caller", "length", "name", "prototype"]
(Firefox.46):
> Object.getOwnPropertyNames(Window).sort()
["length", "name", "prototype"]
(Edge.20):
> Object.getOwnPropertyNames(Window).sort()
[ "arguments", "caller", "name", "prototype" ]
Description:
Events (webpage-events) are DOINGS in a-webpage, such as mouse clicks, mouse overs, etc.
Events AND associated functions (the-event-listeners) ARE-REGISTERED on components of the-page (the-targets).
When events occur, their associated event-listeners ARE-TRIGGERED (are-called).
oTarget.addEventListener(sEvent, fEventlistener);
Name:
* cpt.ljb'event-management,
* cpt.ljbevent-management,
* cpt.ljb'event-manipulation,
* cpt.ljb'algEvt,
* cpt.ljbalgEvt,
Whole-part-tree:
Generic-specific-tree:
Description:
Ljb-event-object is an-object that represents webpage-events (its archetype).
Ljb has many constructors that create event-objects.
All event-objects inherit from Event.prototype
.
Name:
* cpt.ljb'event-object,
* cpt.ljbevent-object,
* cpt.ljb'evtobt,
* cpt.ljbevtobt,
* cpt.ljboEvt,
Whole-chain:
* the-semantic-unit in which defined.
Generic-chain:
* Constructor.prototype,
* Event.prototype,
* Object.prototype,
Member:
The-members of an-oEvt depend of the-constructor used to create them.
Constructor:
These constructors create oEvts.
* ApplicationCacheErrorEvent,
* AudioProcessingEvent,
* AutocompleteErrorEvent,
* BeforeUnloadEvent,
* CloseEvent,
* CompositionEvent,
* CustomEvent,
* DeviceMotionEvent,
* DeviceOrientationEvent,
* DragEvent,
* ErrorEvent,
* Event,
* FocusEvent,
* GamepadEvent,
* HashChangeEvent,
* IDBVersionChangeEvent,
* KeyboardEvent,
* MediaKeyMessageEvent,
* MediaStreamEvent,
* MessageEvent,
* MouseEvent,
* MutationEvent,
* OfflineAudioCompletionEvent,
* PageTransitionEvent,
* PopStateEvent,
* ProgressEvent,
* SpeechSynthesisEvent,
* StorageEvent,
* SVGZoomEvent,
* TextEvent,
* TouchEvent,
* TrackEvent,
* TransitionEvent,
* UIEvent,
* WebGLContextEvent,
* WebKitAnimationEvent,
* WebKitTransitionEvent,
* WheelEvent,
Description:
Ljb-event-listener-function is a-function that is-called when the-event occurs on a-target.
Name:
* cpt.ljb'event-listener-function,
* cpt.ljbevent-listener-function,
* cpt.ljb'event-listener,
* cpt.ljbevent-listener,
* cpt.ljb'fEvtlnr,
* cpt.ljbfEvtlnr,
Whole-chain:
* the-semantic-unit in which defined.
Generic-chain:
* Function.prototype,
* Object.prototype,
Description:
Ljb-event-target-object is an-object that represents an-HML-element of the-webpage on which the-event is-registered.
Name:
* cpt.ljb'event-target-object,
* cpt.ljbevent-target-object,
* cpt.ljb'event-target,
* cpt.ljbevent-target,
* cpt.ljb'oEvttgt,
* cpt.ljboEvttgt,
Whole-chain:
* the-semantic-unit in which defined.
Generic-chain:
* ...
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
===
All targets are specific of EventTarget.prototype
which contains the-method addEventListener()
we need to add listeners on targets.
Description:
Event.prototype
is the-generic-object of all ljb-event-objects which represent webpage-events.
Name:
* cpt.ljb'Event.prototype,
* cpt.ljbEvent.prototype,
Whole-chain:
* Event-function,
* window, (window.Event //function Event() { [native code] }
)
Generic-chain:
* Object.prototype, (Event.prototype.__proto__ === Object.prototype //true
)
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Event.prototype).sort()
["AT_TARGET", "BLUR", "BUBBLING_PHASE", "CAPTURING_PHASE", "CHANGE", "CLICK", "DBLCLICK", "DRAGDROP", "FOCUS", "KEYDOWN", "KEYPRESS", "KEYUP", "MOUSEDOWN", "MOUSEDRAG", "MOUSEMOVE", "MOUSEOUT", "MOUSEOVER", "MOUSEUP", "NONE", "SELECT", "bubbles", "cancelBubble", "cancelable", "constructor", "currentTarget", "defaultPrevented", "eventPhase", "initEvent", "path", "preventDefault", "returnValue", "srcElement", "stopImmediatePropagation", "stopPropagation", "target", "timeStamp", "type"]
(Firefox.46):
> Object.getOwnPropertyNames(Event.prototype).sort()
[]
(Edge.20):
> Object.getOwnPropertyNames(Event.prototype).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Event.prototype).sort()
[]
Description:
Event
is a -constructor of ljb-event-objects which contains the-Event.prototype, the-generic of all oEvts.
Name:
* cpt.ljb'Event,
* cpt.ljbEvent,
* cpt.ljb'Event-constructor,
* cpt.ljbEvent-constructor,
* cpt.ljb'Event-function,
* cpt.ljbEvent-function,
Whole-chain:
* window, (window.Event //function Event() { [native code] }
)
Generic-chain:
* Function.prototype, (Event.__proto__ === Function.prototype //true
)
* Object.prototype, (Event.__proto__.__proto__ === Object.prototype //true
)
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Event).sort()
["AT_TARGET", "BLUR", "BUBBLING_PHASE", "CAPTURING_PHASE", "CHANGE", "CLICK", "DBLCLICK", "DRAGDROP", "FOCUS", "KEYDOWN", "KEYPRESS", "KEYUP", "MOUSEDOWN", "MOUSEDRAG", "MOUSEMOVE", "MOUSEOUT", "MOUSEOVER", "MOUSEUP", "NONE", "SELECT", "arguments", "caller", "length", "name", "prototype"]
(Firefox.46):
> Object.getOwnPropertyNames(Event).sort()
["ALT_MASK", "AT_TARGET", "BUBBLING_PHASE", "CAPTURING_PHASE", "CONTROL_MASK", "META_MASK", "NONE", "SHIFT_MASK", "length", "name", "prototype"]
(Edge.20):
> Object.getOwnPropertyNames(Event).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Event).sort()
[]
Description:
EventTarget.prototype
is the-generic-object of Node.prototype, and thus of any component of a-webpage.
Name:
* cpt.ljb'EventTarget.prototype,
* cpt.ljbEventTarget.prototype,
Whole-chain:
* EventTarget-function,
* window, (window.EventTarget //function EventTarget() { [native code] }
)
Generic-chain:
* Object.prototype, (EventTarget.prototype.__proto__ === Object.prototype //true
)
Member:
(Chrome.50):
> Object.getOwnPropertyNames(EventTarget.prototype).sort()
["addEventListener", "constructor", "dispatchEvent", "removeEventListener"]
(Firefox.46):
> Object.getOwnPropertyNames(EventTarget.prototype).sort()
["addEventListener", "constructor", "dispatchEvent", "removeEventListener"]
(Edge.20):
> Object.getOwnPropertyNames(EventTarget.prototype).sort()
["addEventListener", "constructor", "dispatchEvent", "removeEventListener"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(EventTarget.prototype).sort()
[]
Description:
EventTarget
is the-constructor of the-EventTarget.prototype.
Name:
* cpt.ljb'EventTarget,
* cpt.ljbEventTarget,
* cpt.ljb'EventTarget-constructor,
* cpt.ljbEventTarget-constructor,
* cpt.ljb'EventTarget-function,
* cpt.ljbEventTarget-function,
Whole-chain:
* window, (window.EventTarget //function EventTarget() { [native code] }
)
Generic-chain:
* Function.prototype, (EventTarget.__proto__ === Function.prototype //true
)
* Object.prototype, (EventTarget.__proto__.__proto__ === Object.prototype //true
)
Member:
(Chrome.50):
> Object.getOwnPropertyNames(EventTarget).sort()
["arguments", "caller", "length", "name", "prototype"]
(Firefox.46):
> Object.getOwnPropertyNames(EventTarget).sort()
["length", "name", "prototype"]
(Edge.20):
> Object.getOwnPropertyNames(EventTarget).sort()
["arguments", "caller", "name", "prototype"]
Specific:
* Window, (Window.__proto__ === EventTarget //true
)
Description:
ALL ljb-algorithms manage HML, because ljb-code is part of an-HML-document and this reason of existance of ljb.
Name:
* cpt.ljb'HML-management,
* cpt.ljbHML-management,
* cpt.ljb'algHml,
* cpt.ljbalgHml,
Name:
* cpt.ljb'HML-API,
* cpt.ljb'hml-API,
* cpt.ljb'API.HML,
ljb'Hml-API'Whole-part-tree:
ljb'Hml-API'Generic-specific-tree:
Description:
DOM is a-specification of an-HML-document representation in ljb.
Name:
* cpt.ljb'DOM,
* cpt.ljbDOM,
* cpt.ljb'Document-Object-Model,
* cpt.ljbDocument-Object-Model,
Spec:
The-spec: https://www.w3.org/TR/domcore/
Description:
document
is the-object that represents an-HML-document.
document
is an-objectof HTMLDocument
constructor-function.
document
is an-instance of HTMLDocument.prototype
.
Name:
* cpt.ljb'document,
* cpt.ljbdocument,
* cpt.ljb'document-object,
* cpt.ljbdocument-object,
Whole-chain:
* window, (window.document //#document
)
Generic-chain:
* HTMLDocument.prototype,
* Document.prototype,
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(document).sort()
["location"]
(Firefox.46):
> Object.getOwnPropertyNames(document).sort()
["location"]
(Edge.20):
> Object.getOwnPropertyNames(document).sort()
["__IE_DEVTOOLBAR_CONSOLE_EVAL_ERROR", "__IE_DEVTOOLBAR_CONSOLE_EVAL_ERRORCODE", "__IE_DEVTOOLBAR_CONSOLE_EVAL_RESULT, "closure_lm_199280", "closure_lm_736068", "f"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(document).sort()
["URL", "_html5shiv", "activeElement", "alinkColor", "all", "anchors", "applets", "attributes", "baseURI", "bgColor", "body", "characterSet", "charset", "childNodes", "compatMode", "constructor", "cookie", "defaultCharset", "defaultView", "designMode", "dir", "doctype", "documentElement", "documentURI", "domain", "embeds", "fgColor", "firstChild", "forms", "head", "height", "images", "implementation", "inputEncoding", "lastChild", "lastModified", "linkColor", "links", "localName", "location", "namespaceURI", "nextSibling", "nodeName", "nodeType", "nodeValue", "onabort", "onbeforecopy", "onbeforecut", "onbeforepaste", "onblur", "onchange", "onclick", "oncontextmenu", "oncopy", "oncut", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "onerror", "onfocus", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onpaste", "onreadystatechange", "onreset", "onscroll", "onsearch", "onselect", "onselectionchange", "onselectstart", "onsubmit", "onwebkitfullscreenchange", "ownerDocument", "parentElement", "parentNode", "plugins", "preferredStylesheetSet", "prefix", "previousSibling", "readyState", "referrer", "scripts", "selectedStylesheetSet", "styleSheets", "textContent", "title", "vlinkColor", "webkitCurrentFullScreenElement", "webkitFullScreenKeyboardInputAllowed", "webkitIsFullScreen", "width", "xmlEncoding", "xmlStandalone", "xmlVersion"]
Description:
HTMLDocument.prototype
is the-generic-object of document
.
document
is an-instance of HTMLDocument.prototype
.
document
is an-objectof HTMLDocument
.
Name:
* cpt.ljb'HTMLDocument.prototype,
* cpt.ljbHTMLDocument.prototype,
Whole-chain:
* HTMLDocument-function,
* window,
Generic-chain:
* Document.prototype,
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(HTMLDocument.prototype).sort()
["alinkColor", "all", "bgColor", "captureEvents", "clear", "constructor", "fgColor", "linkColor", "releaseEvents", "vlinkColor"]
(Firefox.46):
> Object.getOwnPropertyNames(HTMLDocument.prototype).sort()
["alinkColor", "all", "anchors", "applets", "bgColor", "body", "captureEvents", "clear", "close", "constructor", "cookie", "designMode", "domain", "embeds", "execCommand", "fgColor", "forms", "getElementsByName", "getItems", "getSelection", "head", "images", "linkColor", "links", "open", "plugins", "queryCommandEnabled", "queryCommandIndeterm", "queryCommandState", "queryCommandSupported", "queryCommandValue", "releaseEvents", "scripts", "vlinkColor", "write", "writeln"]
(Edge.20):
> Object.getOwnPropertyNames(HTMLDocument.prototype).sort()
["constructor"]
(Safari.5.1.7):
> Object.getOwnPropertyNames(HTMLDocument.prototype).sort()
["captureEvents", "clear", "close", "hasFocus", "open", "releaseEvents", "write", "writeln"]
Description:
Document.prototype
is the-generic-object of any object created with the-Document-constructor-function.
Name:
* cpt.ljb'Document.prototype,
* cpt.ljbDocument.prototype,
Whole-chain:
* Document-function,
* window,
Generic-chain:
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Document.prototype).sort()
["URL", "activeElement", "adoptNode", "anchors", "applets", "body", "caretRangeFromPoint", "characterSet", "charset", "childElementCount", "children", "close", "compatMode", "constructor", "contentType", "cookie", "createAttribute", "createAttributeNS", "createCDATASection", "createComment", "createDocumentFragment", "createElement", "createElementNS", "createEvent", "createExpression", "createNSResolver", "createNodeIterator", "createProcessingInstruction", "createRange", "createTextNode", "createTreeWalker", "currentScript", "defaultView", "designMode", "dir", "doctype", "documentElement", "documentURI", "domain", "elementFromPoint", "elementsFromPoint", "embeds", "evaluate", "execCommand", "exitPointerLock", "firstElementChild", "fonts", "forms", "getElementById", "getElementsByClassName", "getElementsByName", "getElementsByTagName", "getElementsByTagNameNS", "getSelection", "hasFocus", "head", "hidden", "images", "implementation", "importNode", "inputEncoding", "lastElementChild", "lastModified", "links", "onabort", "onautocomplete", "onautocompleteerror", "onbeforecopy", "onbeforecut", "onbeforepaste", "onblur", "oncancel", "oncanplay", "oncanplaythrough", "onchange", "onclick", "onclose", "oncontextmenu", "oncopy", "oncuechange", "oncut", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onpaste", "onpause", "onplay", "onplaying", "onpointerlockchange", "onpointerlockerror", "onprogress", "onratechange", "onreadystatechange", "onreset", "onresize", "onscroll", "onsearch", "onseeked", "onseeking", "onselect", "onselectionchange", "onselectstart", "onshow", "onstalled", "onsubmit", "onsuspend", "ontimeupdate", "ontoggle", "onvolumechange", "onwaiting", "onwebkitfullscreenchange", "onwebkitfullscreenerror", "onwheel", "open", "origin", "plugins", "pointerLockElement", "preferredStylesheetSet", "queryCommandEnabled", "queryCommandIndeterm", "queryCommandState", "queryCommandSupported", "queryCommandValue", "querySelector", "querySelectorAll", "readyState", "referrer", "registerElement", "rootElement", "scripts", "scrollingElement", "selectedStylesheetSet", "styleSheets", "title", "visibilityState", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitHidden", "webkitIsFullScreen", "webkitVisibilityState", "write", "writeln", "xmlEncoding", "xmlStandalone", "xmlVersion"]
(Firefox.46):
> Object.getOwnPropertyNames(Document.prototype).sort()
["URL", "activeElement", "adoptNode", "caretPositionFromPoint", "characterSet", "charset", "childElementCount", "children", "compatMode", "constructor", "contentType", "createAttribute", "createAttributeNS", "createCDATASection", "createComment", "createDocumentFragment", "createElement", "createElementNS", "createEvent", "createExpression", "createNSResolver", "createNodeIterator", "createProcessingInstruction", "createRange", "createTextNode", "createTreeWalker", "currentScript", "defaultView", "dir", "doctype", "documentElement", "documentURI", "elementFromPoint", "elementsFromPoint", "enableStyleSheetsForSet", "evaluate", "firstElementChild", "fonts", "getElementById", "getElementsByClassName", "getElementsByTagName", "getElementsByTagNameNS", "hasFocus", "hidden", "implementation", "importNode", "inputEncoding", "lastElementChild", "lastModified", "lastStyleSheetSet", "mozCancelFullScreen", "mozExitPointerLock", "mozFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozHidden", "mozPointerLockElement", "mozSetImageElement", "mozVisibilityState", "onabort", "onafterscriptexecute", "onbeforescriptexecute", "onblur", "oncanplay", "oncanplaythrough", "onchange", "onclick", "oncontextmenu", "oncopy", "oncut", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmozfullscreenchange", "onmozfullscreenerror", "onmozpointerlockchange", "onmozpointerlockerror", "onpaste", "onpause", "onplay", "onplaying", "onprogress", "onratechange", "onreadystatechange", "onreset", "onresize", "onscroll", "onseeked", "onseeking", "onselect", "onshow", "onstalled", "onsubmit", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting", "onwheel", "preferredStyleSheetSet", "querySelector", "querySelectorAll", "readyState", "referrer", "releaseCapture", "selectedStyleSheetSet", "styleSheetSets", "styleSheets", "title", "visibilityState"]
(Edge.20):
> Object.getOwnPropertyNames(Document.prototype).sort()
[190 members]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Document.prototype).sort()
["adoptNode", "caretRangeFromPoint", "createAttribute", "createAttributeNS", "createCDATASection", "createComment", "createDocumentFragment", "createElement", "createElementNS", "createEntityReference", "createEvent", "createExpression", "createNSResolver", "createNodeIterator", "createProcessingInstruction", "createRange", "createTextNode", "createTreeWalker", "elementFromPoint", "evaluate", "execCommand", "getCSSCanvasContext", "getElementById", "getElementsByClassName", "getElementsByName", "getElementsByTagName", "getElementsByTagNameNS", "getOverrideStyle", "getSelection", "importNode", "queryCommandEnabled", "queryCommandIndeterm", "queryCommandState", "queryCommandSupported", "queryCommandValue", "querySelector", "querySelectorAll", "webkitCancelFullScreen"]
Description:
Node.prototype
is the-generic-object of any oNode
objectof Node
constructor-function.
Name:
* cpt.ljb'Node.prototype,
* cpt.ljbNode.prototype,
Whole-chain:
* Node-function,
* window,
Generic-chain:
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Node.prototype).sort()
["ATTRIBUTE_NODE", "CDATA_SECTION_NODE", "COMMENT_NODE", "DOCUMENT_FRAGMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_DISCONNECTED", "DOCUMENT_POSITION_FOLLOWING", "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", "DOCUMENT_POSITION_PRECEDING", "DOCUMENT_TYPE_NODE", "ELEMENT_NODE", "ENTITY_NODE", "ENTITY_REFERENCE_NODE", "NOTATION_NODE", "PROCESSING_INSTRUCTION_NODE", "TEXT_NODE", "appendChild", "baseURI", "childNodes", "cloneNode", "compareDocumentPosition", "constructor", "contains", "firstChild", "hasChildNodes", "insertBefore", "isDefaultNamespace", "isEqualNode", "isSameNode", "lastChild", "lookupNamespaceURI", "lookupPrefix", "nextSibling", "nodeName", "nodeType", "nodeValue", "normalize", "ownerDocument", "parentElement", "parentNode", "previousSibling", "removeChild", "replaceChild", "textContent"]
(Firefox.46):
> Object.getOwnPropertyNames(Node.prototype).sort()
["ATTRIBUTE_NODE", "CDATA_SECTION_NODE", "COMMENT_NODE", "DOCUMENT_FRAGMENT_NODE", "DOCUMENT_NODE", "DOCUMENT_POSITION_CONTAINED_BY", "DOCUMENT_POSITION_CONTAINS", "DOCUMENT_POSITION_DISCONNECTED", "DOCUMENT_POSITION_FOLLOWING", "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", "DOCUMENT_POSITION_PRECEDING", "DOCUMENT_TYPE_NODE", "ELEMENT_NODE", "ENTITY_NODE", "ENTITY_REFERENCE_NODE", "NOTATION_NODE", "PROCESSING_INSTRUCTION_NODE", "TEXT_NODE", "appendChild", "baseURI", "childNodes", "cloneNode", "compareDocumentPosition", "constructor", "contains", "firstChild", "hasChildNodes", "insertBefore", "isDefaultNamespace", "isEqualNode", "lastChild", "localName", "lookupNamespaceURI", "lookupPrefix", "namespaceURI", "nextSibling", "nodeName", "nodeType", "nodeValue", "normalize", "ownerDocument", "parentElement", "parentNode", "prefix", "previousSibling", "removeChild", "replaceChild", "textContent"]
(Edge.20):
> Object.getOwnPropertyNames(Node.prototype).sort()
[51 members]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Node.prototype).sort()
["adoptNode", "caretRangeFromPoint", "createAttribute", "createAttributeNS", "createCDATASection", "createComment", "createDocumentFragment", "createElement", "createElementNS", "createEntityReference", "createEvent", "createExpression", "createNSResolver", "createNodeIterator", "createProcessingInstruction", "createRange", "createTextNode", "createTreeWalker", "elementFromPoint", "evaluate", "execCommand", "getCSSCanvasContext", "getElementById", "getElementsByClassName", "getElementsByName", "getElementsByTagName", "getElementsByTagNameNS", "getOverrideStyle", "getSelection", "importNode", "queryCommandEnabled", "queryCommandIndeterm", "queryCommandState", "queryCommandSupported", "queryCommandValue", "querySelector", "querySelectorAll", "webkitCancelFullScreen"]
Specific:
* Attr.prototype,
* CharacterData.prototype,
* Document.prototype,
* DocumentFragment.prototype,
* DocumentType.prototype,
* Element.prototype,
Description:
Attr.prototype
is the-generic-object of oAttr
[1] objectof Attr
constructor, which[1] represents HML-attributes.
Name:
* cpt.ljb'Attr.prototype,
* cpt.ljbAttr.prototype,
Whole-chain:
* Attr-function,
* window,
Generic-chain:
* Node.prototype, (Attr.prototype.__proto__ === Node.prototype //true
)
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Attr.prototype).sort()
["constructor", "localName", "name", "namespaceURI", "nodeValue", "ownerElement", "prefix", "specified", "textContent", "value"]
(Firefox.46):
> Object.getOwnPropertyNames(Attr.prototype).sort()
["constructor", "localName", "name", "namespaceURI", "ownerElement", "prefix", "specified", "value"]
(Edge.20):
> Object.getOwnPropertyNames(Attr.prototype).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Attr.prototype).sort()
[]
Description:
CharacterData.prototype
is the-generic-object of Comment.prototype
and Text.prototype
.
Name:
* cpt.ljb'CharacterData.prototype,
* cpt.ljbCharacterData.prototype,
Whole-chain:
* CharacterData-function,
* window,
Generic-chain:
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(CharacterData.prototype).sort()
["appendData", "constructor", "data", "deleteData", "insertData", "length", "nextElementSibling", "previousElementSibling", "remove", "replaceData", "substringData"]
(Firefox.46):
> Object.getOwnPropertyNames(CharacterData.prototype).sort()
["appendData", "constructor", "data", "deleteData", "insertData", "length", "nextElementSibling", "previousElementSibling", "remove", "replaceData", "substringData"]
(Edge.20):
> Object.getOwnPropertyNames(CharacterData.prototype).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(CharacterData.prototype).sort()
[]
Description:
DocumentFragment.prototype
is the-generic-object of oDocumentFragment
[1] objectof DocumentFragment
constructor, which[1] represents a PART of an-HML-document.
Using oDocumentFragments instead of the whole HML-document (document
) increases processing speed.
Name:
* cpt.ljb'DocumentFragment.prototype,
* cpt.ljbDocumentFragment.prototype,
Whole-chain:
* DocumentFragment-function,
* window,
Generic-chain:
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(DocumentFragment.prototype).sort()
["childElementCount", "children", "constructor", "firstElementChild", "getElementById", "lastElementChild", "querySelector", "querySelectorAll"]
(Firefox.46):
> Object.getOwnPropertyNames(DocumentFragment.prototype).sort()
["childElementCount", "children", "constructor", "firstElementChild", "getElementById", "lastElementChild", "querySelector", "querySelectorAll"]
(Edge.20):
> Object.getOwnPropertyNames(DocumentFragment.prototype).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(DocumentFragment.prototype).sort()
[]
Description:
DocumentType.prototype
is the-generic-object of oDocumentType
[1] objectof DocumentType
constructor, which[1] represents a-doctype HML-element.
Name:
* cpt.ljb'DocumentType.prototype,
* cpt.ljbDocumentType.prototype,
Whole-chain:
* DocumentType-function,
* window,
Generic-chain:
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(DocumentType.prototype).sort()
["constructor", "name", "publicId", "remove", "systemId"]
(Firefox.46):
> Object.getOwnPropertyNames(DocumentType.prototype).sort()
["constructor", "name", "publicId", "remove", "systemId"]
(Edge.20):
> Object.getOwnPropertyNames(DocumentType.prototype).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(DocumentType.prototype).sort()
[]
Description:
Element.prototype
[1] is the-generic-object of HTMLElement.prototype
.
It[1] contains important members for the-objects that represent HML-elements.
Name:
* cpt.ljb'Element.prototype,
* cpt.ljbElement.prototype,
Whole-chain:
* Element-function,
* window,
Generic-chain:
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(Element.prototype).sort()
["animate", "attributes", "childElementCount", "children", "classList", "className", "clientHeight", "clientLeft", "clientTop", "clientWidth", "closest", "constructor", "createShadowRoot", "firstElementChild", "getAttribute", "getAttributeNS", "getAttributeNode", "getAttributeNodeNS", "getBoundingClientRect", "getClientRects", "getDestinationInsertionPoints", "getElementsByClassName", "getElementsByTagName", "getElementsByTagNameNS", "hasAttribute", "hasAttributeNS", "hasAttributes", "id", "innerHTML", "insertAdjacentElement", "insertAdjacentHTML", "insertAdjacentText", "lastElementChild", "localName", "matches", "namespaceURI", "nextElementSibling", "onbeforecopy", "onbeforecut", "onbeforepaste", "oncopy", "oncut", "onpaste", "onsearch", "onselectstart", "onwebkitfullscreenchange", "onwebkitfullscreenerror", "onwheel", "outerHTML", "prefix", "previousElementSibling", "querySelector", "querySelectorAll", "remove", "removeAttribute", "removeAttributeNS", "removeAttributeNode", "requestPointerLock", "scrollHeight", "scrollIntoView", "scrollIntoViewIfNeeded", "scrollLeft", "scrollTop", "scrollWidth", "setAttribute", "setAttributeNS", "setAttributeNode", "setAttributeNodeNS", "shadowRoot", "tagName", "webkitMatchesSelector", "webkitRequestFullScreen", "webkitRequestFullscreen"]
(Firefox.46):
> Object.getOwnPropertyNames(Element.prototype).sort()
["attributes", "childElementCount", "children", "classList", "className", "clientHeight", "clientLeft", "clientTop", "clientWidth", "closest", "constructor", "firstElementChild", "getAttribute", "getAttributeNS", "getAttributeNames", "getAttributeNode", "getAttributeNodeNS", "getBoundingClientRect", "getClientRects", "getElementsByClassName", "getElementsByTagName", "getElementsByTagNameNS", "hasAttribute", "hasAttributeNS", "hasAttributes", "id", "innerHTML", "insertAdjacentHTML", "lastElementChild", "matches", "mozMatchesSelector", "mozRequestFullScreen", "mozRequestPointerLock", "nextElementSibling", "onwheel", "outerHTML", "previousElementSibling", "querySelector", "querySelectorAll", "releaseCapture", "remove", "removeAttribute", "removeAttributeNS", "removeAttributeNode", "scroll", "scrollBy", "scrollHeight", "scrollIntoView", "scrollLeft", "scrollLeftMax", "scrollTo", "scrollTop", "scrollTopMax", "scrollWidth", "setAttribute", "setAttributeNS", "setAttributeNode", "setAttributeNodeNS", "setCapture", "tagName", "webkitMatchesSelector"]
(Edge.20):
> Object.getOwnPropertyNames(Element.prototype).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(Element.prototype).sort()
[]
Specific:
* HTMLElement.prototype,
Description:
HTMLElement.prototype
[1] is the-generic-object of the-objects that represent HML-elements.
Name:
* cpt.ljb'HTMLElement.prototype,
* cpt.ljbHTMLElement.prototype,
Whole-chain:
* HTMLElement-function,
* window,
Generic-chain:
* Element.prototype,
* Node.prototype,
* EventTarget.prototype,
* Object.prototype,
Member:
(Chrome.50):
> Object.getOwnPropertyNames(HTMLElement.prototype).sort()
["accessKey", "blur", "click", "constructor", "contentEditable", "dataset", "dir", "draggable", "focus", "hidden", "innerText", "isContentEditable", "lang", "offsetHeight", "offsetLeft", "offsetParent", "offsetTop", "offsetWidth", "onabort", "onautocomplete", "onautocompleteerror", "onblur", "oncancel", "oncanplay", "oncanplaythrough", "onchange", "onclick", "onclose", "oncontextmenu", "oncuechange", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onpause", "onplay", "onplaying", "onprogress", "onratechange", "onreset", "onresize", "onscroll", "onseeked", "onseeking", "onselect", "onshow", "onstalled", "onsubmit", "onsuspend", "ontimeupdate", "ontoggle", "onvolumechange", "onwaiting", "outerText", "spellcheck", "style", "tabIndex", "title", "translate", "webkitdropzone"]
(Firefox.46):
> Object.getOwnPropertyNames(HTMLElement.prototype).sort()
["accessKey", "accessKeyLabel", "blur", "click", "constructor", "contentEditable", "contextMenu", "dataset", "dir", "draggable", "focus", "hidden", "innerText", "isContentEditable", "itemId", "itemProp", "itemRef", "itemScope", "itemType", "itemValue", "lang", "offsetHeight", "offsetLeft", "offsetParent", "offsetTop", "offsetWidth", "onabort", "onblur", "oncanplay", "oncanplaythrough", "onchange", "onclick", "oncontextmenu", "oncopy", "oncut", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmozfullscreenchange", "onmozfullscreenerror", "onmozpointerlockchange", "onmozpointerlockerror", "onpaste", "onpause", "onplay", "onplaying", "onprogress", "onratechange", "onreset", "onresize", "onscroll", "onseeked", "onseeking", "onselect", "onshow", "onstalled", "onsubmit", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting", "properties", "spellcheck", "style", "tabIndex", "title"]
(Edge.20):
> Object.getOwnPropertyNames(Element.prototype).sort()
[]
(Safari.5.1.7):
> Object.getOwnPropertyNames(HTMLElement.prototype).sort()
[]
Specific:
* HTMLAnchorElement.prototype,
** oHTMLAnchorElement,
* HTMLAreaElement.prototype,
** oHTMLAreaElement,
* HTMLAudioElement.prototype,
** oHTMLAudioElement,
* HTMLBRElement.prototype,
** oHTMLBRElement,
* HTMLBaseElement.prototype,
** oHTMLBaseElement,
* HTMLBodyElement.prototype,
** oHTMLBodyElement,
* HTMLButtonElement.prototype,
** oHTMLButtonElement,
* HTMLCanvasElement.prototype,
** oHTMLCanvasElement,
* HTMLContentElement.prototype,
** oHTMLContentElement,
* HTMLDListElement.prototype,
** oHTMLDListElement,
* HTMLDataListElement.prototype,
** oHTMLDataListElement,
* HTMLDetailsElement.prototype,
** oHTMLDetailsElement,
* HTMLDialogElement.prototype,
** oHTMLDialogElement,
* HTMLDirectoryElement.prototype,
** oHTMLDirectoryElement,
* HTMLDivElement.prototype,
** oHTMLDivElement,
* HTMLEmbedElement.prototype,
** oHTMLEmbedElement,
* HTMLFieldSetElement.prototype,
** oHTMLFieldSetElement,
* HTMLFontElement.prototype,
** oHTMLFontElement,
* HTMLFormElement.prototype,
** oHTMLFormElement,
* HTMLFrameElement.prototype,
** oHTMLFrameElement,
* HTMLFrameSetElement.prototype,
** oHTMLFrameSetElement,
* HTMLHRElement.prototype,
** oHTMLHRElement,
* HTMLHeadElement.prototype,
** oHTMLHeadElement,
* HTMLHeadingElement.prototype,
** oHTMLHeadingElement,
* HTMLHtmlElement.prototype,
** oHTMLHtmlElement,
* HTMLIFrameElement.prototype,
** oHTMLIFrameElement,
* HTMLImageElement.prototype,
** oHTMLImageElement,
* HTMLInputElement.prototype,
** oHTMLInputElement,
* HTMLKeygenElement.prototype,
** oHTMLKeygenElement,
* HTMLLIElement.prototype,
** oHTMLLIElement,
* HTMLLabelElement.prototype,
** oHTMLLabelElement,
* HTMLLegendElement.prototype,
** oHTMLLegendElement,
* HTMLLinkElement.prototype,
** oHTMLLinkElement,
* HTMLMapElement.prototype,
** oHTMLMapElement,
* HTMLMarqueeElement.prototype,
** oHTMLMarqueeElement,
* HTMLMediaElement.prototype,
** oHTMLMediaElement,
* HTMLMenuElement.prototype,
** oHTMLMenuElement,
* HTMLMetaElement.prototype,
** oHTMLMetaElement,
* HTMLMeterElement.prototype,
** oHTMLMeterElement,
* HTMLModElement.prototype,
** oHTMLModElement,
* HTMLOListElement.prototype,
** oHTMLOListElement,
* HTMLObjectElement.prototype,
** oHTMLObjectElement,
* HTMLOptGroupElement.prototype,
** oHTMLOptGroupElement,
* HTMLOptionElement.prototype,
** oHTMLOptionElement,
* HTMLOptionsCollection.prototype,
** oHTMLOptionsCollection,
* HTMLOutputElement.prototype,
** oHTMLOutputElement,
* HTMLParagraphElement.prototype,
** oHTMLParagraphElement,
* HTMLParamElement.prototype,
** oHTMLParamElement,
* HTMLPictureElement.prototype,
** oHTMLPictureElement,
* HTMLPreElement.prototype,
** oHTMLPreElement,
* HTMLProgressElement.prototype,
** oHTMLProgressElement,
* HTMLQuoteElement.prototype,
** oHTMLQuoteElement,
* HTMLScriptElement.prototype,
** oHTMLScriptElement,
* HTMLSelectElement.prototype,
** oHTMLSelectElement,
* HTMLShadowElement.prototype,
** oHTMLShadowElement,
* HTMLSourceElement.prototype,
** oHTMLSourceElement,
* HTMLSpanElement.prototype,
** oHTMLSpanElement,
* HTMLStyleElement.prototype,
** oHTMLStyleElement,
* HTMLTableCaptionElement.prototype,
** oHTMLTableCaptionElement,
* HTMLTableCellElement.prototype,
** oHTMLTableCellElement,
* HTMLTableColElement.prototype,
** oHTMLTableColElement,
* HTMLTableElement.prototype,
** oHTMLTableElement,
* HTMLTableRowElement.prototype,
** oHTMLTableRowElement,
* HTMLTableSectionElement.prototype,
** oHTMLTableSectionElement,
* HTMLTemplateElement.prototype,
** oHTMLTemplateElement,
* HTMLTextAreaElement.prototype,
** oHTMLTextAreaElement,
* HTMLTitleElement.prototype,
** oHTMLTitleElement,
* HTMLTrackElement.prototype,
** oHTMLTrackElement,
* HTMLUListElement.prototype,
** oHTMLUListElement,
* HTMLUnknownElement.prototype,
** oHTMLUnknownElement,
* HTMLVideoElement.prototype,
** oHTMLVideoElement,
Generic:
* ljs-binary-code,
Name:
* cpt.ljb'binary-code,
* cpt.ljbbinary-code,
* cpt.ljb'bcode,
* cpt.ljbbcode,
Generic:
* ljs-evaluation,
Name:
* cpt.ljb'evaluation,
* cpt.ljbevaluation,
Simplicity:
Its code is-created FROM only 11 semantic-units.
Whole-Part-management (modules):
Ljb lacks a-mechanism of organizing its semantic-units into parts.
Like the 'prototype-inheritance' mechanism which manages the generic-specific relations, we need and a-mechanism to manage the whole-part relations.
Today, all its-constructs loaded from js-files reside, in a-mess, inside the-most-whole-object (global).
Now we can-create collections only with objects and arrays.
ECMAScript.6.2015 spec added this mechanism, but it is not implemented by the-browsers.
Generic:
* ljs-tool,
Name:
* cpt.ljb'tool,
* cpt.ljbtool,
Resource:
* Chrome DevTools,
* Firebug,
Description:
Browser is the-program that displays webpages (understands HML and CSS code)and executes ljb code.
Name:
* cpt.ljb'browser,
* cpt.ljbbrowser,
* cpt.ljb'webbrowser,
* cpt.ljbwebbrowser,
* cpt.browser,
* browser-cpt,
* webbrowser-cpt,
Description:
Layout-engine is the-component of the-browser-program that reads and displays the-HML and CSS code of a-webpage.
Name:
* cpt.browser-layout-engine,
* cpt.browser-rendering-engine,
* cpt.layout-engine-of-browser,
* cpt.rendering-engine-of-browser,
Specific:
* Blink (Chrome >28, Opera >15)
* EdgeHTML (Edge),
* Gecko (Firefox),
* WebKit,
Description:
Ljb-engine is the-component of the-browser-program that reads and executes the-code.
Name:
* cpt.ljb'engine,
* cpt.ljbengine,
* cpt.ljb'implementation,
* cpt.ljbimplementation,
* cpt.ljb'interpreter,
* cpt.ljbinterpreter,
* cpt.ljb'runtime,
* cpt.ljbruntime,
Specific:
* SpiderMondey (Firefox),
* V8 (Chrome),
Description:
Webpage is an-HML-document, plus all other files needed, such as images, video, CSS, ljb, etc.
Browsers display webpages.
Name:
* cpt.web-page,
* cpt.webpage,
Part:
* HML-code,
* CSS-code,
* Ljb-code,
* media-files,
Specific:
* Google-Chrome,
* Microsoft-Edge,
* Mozilla-Firefox,
* Safari,
* Opera,
===
* Desktop-browser,
* Mobile-browser,
The-Node.js-language (ljn) is a-javascript-language that is-understood by the-Node.js-runtime.
[synagonism.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.Node.js,
* cpt.Node.js-language,
* cpt.Node-javascript,
* cpt.language.javascript.Node.js,
* cpt.languagejavascriptNode.js,
* lcpNodejs-cpt,
* NodeJS-cpt,
* Node-cpt,
* Node.js-cpt,
* ssjs'Node.js,
=== Abbreviation:
* cpt.ljn,
* ljn-cpt,
* ljn, {2016.05.27}
* lnj, {2016.05.10}
* ljsNd-cpt, {2014.02.16}
* ndjs-cpt,
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:
* ljn-algorithm,
Name:
* cpt.ljn'algorithm,
* cpt.ljn'algo,
* cpt.ljnalgo, {2014.03.10}
===
* cpt.ljnalgo,
* ljnalgo-cpt,
Generic:
* ljs-code,
Name:
* cpt.ljn'code,
* cpt.ljncode,
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.ljnsemantic-unit,
* cpt.ljn'sut,
* cpt.ljnsut,
* ljn'semantic-unit-cpt,
* ljnsemantic-unit-cpt,
* ljn'sut-cpt,
* ljnsut-cpt,
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.ljnfunction,
* cpt.ljnf,
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 30/147]
Generic:
* ljs-object,
Generic:
* ljs-name-value-pair,
Name:
* cpt.ljn'name-value-pair,
* cpt.ljn'nvp,
* cpt.ljnnvp,
* cpt.ljnv,
Description:
Module is a-semantic-unit which CONTAINS other semantic-units.
Like the-'prototype-inheritance' mechanism which manages the generic-specific relations of semantic-units, modules is the-mechanism needed to manage the whole-part relations.
In contrast to objects, modules HAVE scope, ie its members see each other.
Name:
* cpt.ljn'module,
* cpt.ljn'module-semantic-unit,
* cpt.ljn'module-sut,
* cpt.ljn'library,
* cpt.ljnmodule,
* nodejs'library-cpt,
* nodejs'module-cpt,
===
* cpt.ljnm, {2016.06.27}
* ljnm-cpt,
* cpt.ljnmdl, {2016.06.14}
* ljnmdl-cpt,
===
NOTATION: 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.
[synagonism.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.
[synagonism.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.
[synagonism.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.ljnm'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.ljnm'importing,
* cpt.ljnm'loading,
* cpt.ljnm'requiring,
* cpt.ljnm'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.ljnm'exported-member,
* cpt.ljnm'public-member,
* cpt.ljnm'member.public,
* cpt.ljnm'member.localNo,
* cpt.ljnm'member.privateNo,
* cpt.ljnmmbr.public,
Description:
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.ljnm'private-member,
* cpt.ljnm'member.private,
* cpt.ljnm'member.publicNo,
* cpt.ljnm'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]
Name:
* cpt.ljn'__dirname,
* cpt.ljn'dirname,
* cpt.ljn__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.ljnfilename,
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'module,
* cpt.ljnmodule,
* cpt.ljn'module-o, {2016.07.24}
* cpt.ljnmobt, {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.ljnm'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.ljnm'exporting-single-member,
* cpt.ljnm'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.ljnm'exports,
* cpt.ljnexports,
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,
* cpt.ljnrequire,
* cpt.ljn'require-function,
* cpt.ljnrequire-function,
* cpt.ljnf.require,
* ljnrequire-cpt,
Whole-chain:
* module-semantic-unit,
* ljn-most-whole-object (global),
Generic-chain:
* Function.prototype,
* Object.prototype,
Description:
//just write the-module's name
const mFs = 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.ljnm'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.ljnm'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.ljnm'import-by-searching,
* cpt.ljnm'import-from-node_modules,
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:
* ljnglobal.require.resolve,
* ljnrequire.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.ljnm'repository,
* cpt.ljnm'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.ljnnpmjs.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,
* ljn'node_modules-cpt,
* ljn'node_modules-directory-cpt,
* ljn'node_modules-folder-cpt,
* node_modules-cpt,
* node_modules-directory-cpt,
* node_modules-folder-cpt,
AddressWpg:
* http://node-modules.com/
Name:
* cpt.ljnm'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.ljnm'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.ljnstability-index,
* cpt.ljnstability,
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.
[synagonism.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.ljnm.specific,
* ljnm.specific-cpt,
* mdlNode.specific-cpt,
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.ljnm.builtIn,
* cpt.ljnm.customNo,
* cpt.ljnm.internal,
* cpt.ljnm.native,
Specific:
* ljnm.assert,
* ljnm.child_process,
* ljnm.cluster,
* ljnm.crypto,
* ljnm.dns,
* ljnm.events,
* ljnm.fs,
* ljnm.http,
* ljnm.https,
* ljnm.net,
* ljnm.os,
* ljnm.path,
* ljnm.readline,
* ljnm.repl,
* ljnm.stream,
* ljnm.string_decoder,
* ljnm.tls,
* ljnm.tty,
* ljnm.url,
* ljnm.util,
* ljnm.vm,
* ljnm.zlib,
===
// ljn.6-3-1
> 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.ljnassert,
* cpt.ljnm.assert,
* cpt.ljnmfAssert,
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.ljnm.events,
* cpt.ljnmfEvents,
* cpt.ljn'events-function,
* cpt.ljnevents,
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
[synagonism.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.ljnmfEvents'EventEmitter,
* cpt.ljn'EventEmitter,
* cpt.ljnEventEmitter,
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.ljnmfEvents.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.ljnm.stream,
* cpt.ljnmfStream,
* cpt.ljn'mfStream,
* cpt.ljn'stream,
* cpt.ljnstream,
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.ljnm.buffer,
* cpt.ljnmBuffer,
* cpt.ljn'mBuffer,
* cpt.ljn'buffer,
* cpt.ljnbuffer,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mBuffer.__proto__ === Object.prototype)
Member:
// ljn.6-3-1
// Object.getOwnPropertyNames(mBuffer).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.ljnchild_process,
* cpt.ljnm.child_process,
* cpt.ljnmChild_process,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mChild_process.__proto__ === Object.prototype //true)
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.ljn'cluster-module,
* cpt.ljn'mCluster,
* cpt.ljnmCluster,
* cpt.ljncluster,
* cpt.ljn'cluster,
* cpt.ljn'cluster-object,
* cluster-module-cpt,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* events.prototype (mCluster.__proto__ === mfEvents.prototype //true)
* Object.prototype (mCluster.__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.ljncrypto,
* cpt.ljnm.crypto,
* cpt.ljnmCrypto,
* cpt.ljn'crypto-object,
* cpt.ljn'crypto-module,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype (mCrypto.__proto__ === Object.prototype //true)
Member:
// ljn.6-3-1
// Object.getOwnPropertyNames(mCrypto).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.ljndns,
* cpt.ljnm.dns,
* cpt.ljnmDns,
* cpt.ljn'dns-object,
* cpt.ljn'dns-module,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype (mDns.__proto__ === Object.prototype //true)
ljndns'Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mDns).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' ]
===
// mDns
{ 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.
[http://nodejs.org/api/all.html#all_file_system]
Name:
* cpt.ljn'file-system-module,
* cpt.ljn'fs-module,
* cpt.ljn'fs-object,
* cpt.ljnm.fs,
* cpt.ljnmFs,
* cpt.ljnfs,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mFs.__proto__ === Object.prototype //true)
AddressWpg:
* http://nodejs.org/api/all.html#all_file_system,
mFs'Member:
// ljn.6-3-1
// Object.getOwnPropertyNames(mFs).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' ]
===
mFs.ReadStream_Class
mFs.Stats_Class
mFs.WriteStream_Class
mFs.appendFile(filename, data, [options], callback)
mFs.appendFileSync(filename, data, [options])
mFs.chmod(path, mode, callback)
mFs.chmodSync(path, mode)
mFs.chown(path, uid, gid, callback)
mFs.chownSync(path, uid, gid)
mFs.close(fd, callback)
mFs.closeSync(fd)
mFs.createReadStream(path, [options])
mFs.createWriteStream(path, [options])
mFs.exists(path, callback)
mFs.existsSync(path)
mFs.fchmod(fd, mode, callback)
mFs.fchmodSync(fd, mode)
mFs.fchown(fd, uid, gid, callback)
mFs.fchownSync(fd, uid, gid)
mFs.fstat(fd, callback)
mFs.fstatSync(fd)
mFs.fsync(fd, callback)
mFs.fsyncSync(fd)
mFs.ftruncate(fd, len, callback)
mFs.ftruncateSync(fd, len)
mFs.futimes(fd, atime, mtime, callback)
mFs.futimesSync(fd, atime, mtime)
mFs.lchmod(path, mode, callback)
mFs.lchmodSync(path, mode)
mFs.lchown(path, uid, gid, callback)
mFs.lchownSync(path, uid, gid)
mFs.link(srcpath, dstpath, callback)
mFs.linkSync(srcpath, dstpath)
mFs.lstat(path, callback)
mFs.lstatSync(path)
mFs.mkdir(path, [mode], callback)
mFs.mkdirSync(path, [mode])
mFs.open(path, flags, [mode], callback)
mFs.openSync(path, flags, [mode])
mFs.read(fd, buffer, offset, length, position, callback)
mFs.readFile(filename, [options], callback)
mFs.readFileSync(filename, [options])
mFs.readSync(fd, buffer, offset, length, position)
mFs.readdir(path, callback)
mFs.readdirSync(path)
mFs.readlink(path, callback)
mFs.readlinkSync(path)
mFs.realpath(path, [cache], callback)
mFs.realpathSync(path, [cache])
mFs.rename(oldPath, newPath, callback)
mFs.renameSync(oldPath, newPath)
mFs.rmdir(path, callback)
mFs.rmdirSync(path)
mFs.stat(path, callback)
mFs.statSync(path)
mFs.symlink(srcpath, dstpath, [type], callback)
mFs.symlinkSync(srcpath, dstpath, [type])
mFs.truncate(path, len, callback)
mFs.truncateSync(path, len)
mFs.unlink(path, callback)
mFs.unlinkSync(path)
mFs.unwatchFile(filename, [listener])
mFs.utimes(path, atime, mtime, callback)
mFs.utimesSync(path, atime, mtime)
mFs.watch(filename, [options], [listener])
mFs.watchFile(filename, [options], listener)
mFs.write(fd, buffer, offset, length, position, callback)
mFs.writeFile(filename, data, [options], callback)
mFs.writeFileSync(filename, data, [options])
mFs.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.ljnm.http,
* cpt.ljnmHttp,
* cpt.ljnhttp,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mHttp.__proto__ === Object.prototype //true)
mHttp'Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mHttp).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.ljnm.https,
* cpt.ljnmHttps,
* cpt.ljnhttps,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mHttps.__proto__ === Object.prototype //true)
mHttps'Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mHttps).sort()
[ 'Agent',
'Server',
'createServer',
'get',
'globalAgent',
'request' ]
===
// mHttps
{ 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.ljnm.net,
* cpt.ljnmNet,
* cpt.ljn'net,
* cpt.ljnnet,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mNet.__proto__ === Object.prototype //true)
ljnnet'Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mNet).sort()
[ 'Server', 'Socket', 'Stream', '_createServerHandle', '_normalizeConnectArgs', '_setSimultaneousAccepts', 'connect', 'createConnection', 'createServer', 'isIP', 'isIPv4', 'isIPv6' ]
===
// mNet
{ 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]
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mOs.__proto__ === Object.prototype //true)
ljnos'Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mOs).sort()
[ 'EOL', 'arch', 'cpus', 'endianness', 'freemem', 'getNetworkInterfaces', 'homedir', 'hostname', 'loadavg', 'networkInterfaces', 'platform', 'release', 'tmpDir', 'tmpdir', 'totalmem', 'type', 'uptime', 'userInfo' ]
===
// mOs
{ 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.ljnm.path,
* cpt.ljnmPath,
* cpt.ljnpath,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mPath.__proto__ === Object.prototype //true)
Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mPath).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.ljnm.readline,
* cpt.ljnmReadline,
* cpt.ljn'readline,
* cpt.ljnreadline,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mReadline.__proto__ === Object.prototype //true)
Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mReadline).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.ljnm.string_decoder,
* cpt.ljnmString_decoder,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mString_decoder.__proto__ === Object.prototype //true)
Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mString_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.ljnm.tls,
* cpt.ljnmTls,
* cpt.ljn'tls,
* cpt.ljntls,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mTls.__proto__ === Object.prototype //true)
Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mTls).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.ljnm.url,
* cpt.ljnmUrl,
* cpt.ljn'url,
* cpt.ljnurl,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mUrl.__proto__ === Object.prototype //true)
Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mUrl).sort()
[ 'Url', 'format', 'parse', 'resolve', 'resolveObject' ]
Description:
These functions are in the module 'util'.
Use require('util')
to access them.
[http://nodejs.org/api/all.html#all_util]
Name:
* cpt.ljn'util-module,
* cpt.ljn'util-object,
* cpt.ljnm.util,
* cpt.ljnmUtil,
* cpt.ljn'util,
* cpt.ljnutil,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mUtil.__proto__ === Object.prototype //true)
ljnutil'Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mUtil).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' ]
===
mUtil.format(format, [...])
mUtil.debug(string)
mUtil.error([...])
mUtil.puts([...])
mUtil.print([...])
mUtil.log(string)
mUtil.inspect(object, [options])
mUtil.isArray(object)
mUtil.isRegExp(object)
mUtil.isDate(object)
mUtil.isError(object)
mUtil.pump(readableStream, writableStream, [callback])
mUtil.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.ljnm.vm,
* cpt.ljnmVm,
* cpt.ljn'vm,
* cpt.ljnvm,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mVm.__proto__ === Object.prototype //true)
ljnmVm'Member:
// ljn.6-2-2
// Object.getOwnPropertyNames(mVm).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.ljnm.zlib,
* cpt.ljnmZlib,
* cpt.ljn'zlib,
* cpt.ljnzlib,
Whole-chain:
* module-instance,
* most-whole-object (global),
Generic-chain:
* Object.prototype, (mZlib.__proto__ === Object.prototype //true)
Member:
// ljn.6-3-1
// Object.getOwnPropertyNames(mZlib).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.ljnm.3rd-party,
* cpt.ljnm.non-builtIn,
* cpt.ljnm.custom,
* cpt.ljnm.internalNo,
* cpt.ljnm.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.short:
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.ljnm.directory,
* cpt.ljnm.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.ljnm.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.ljnm.main,
Accessing the-main-module:
(link)
Description:
Dependent-module is any module importing in another.
Name:
* cpt.ljn'dependent-module,
* cpt.ljn'dependency,
* cpt.ljn'mainNo-module,
* cpt.ljnm.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.
[synagonism.2016-07-02]
Name:
* cpt.ljn'apiNtv'whole-part-tree,
* cpt.ljnapiNtv'whole-part-tree,
* cpt.ljn'native-whole-part-tree,
* cpt.ljn'wpt,
* cpt.ljnwpt,
ljn'Whole-part-tree:
Global-member:
// 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' ]
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.ljnAPI's-generic-specific-tree,
* cpt.ljn'generic-specific-tree,
* cpt.ljngeneric-specific-tree,
* cpt.ljn'native-generic-specific-tree,
* cpt.ljnnative-generic-specific-tree,
* cpt.ljn'gst,
* cpt.ljngst,
* cpt.ljn'inheritance-tree,
* cpt.ljninheritance-tree,
ljn'Generic-specific-tree of ljn native-API:
> Object.getPrototypeOf(Array.prototype) === Object.prototype //true
),> Object.getPrototypeOf(Intl) === Object.prototype //true
),Description.short:
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'.
[synagonism.2016-07-04]
Name:
* cpt.ljn'most-whole-object,
* cpt.ljn'global-object,
* cpt.ljn'object.global,
* cpt.ljn'global,
* cpt.ljnglobal,
* cpt.ljn'global-scope,
* cpt.ljnglobal-scope,
* cpt.ljn'global-namespace,
* cpt.ljnglobal-namespace,
* cpt.ljnmwo, {2016.07.22}
* cpt.ljngbl, {2016.07.01}
* ljn'most-whole-object-cpt,
* ljn'global-object-cpt,
* ljn'object.global-cpt,
* ljn'global-cpt,
* ljnglobal-cpt,
* ljn'global-scope-cpt,
* ljnglobal-scope-cpt,
* ljn'global-namespace-cpt,
* ljnglobal-namespace-cpt,
* ljnmwo-cpt,
* ljngbl-cpt,
===
DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
Description:
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]
===
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]
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'.
[synagonism.2016-07-02]
===
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.
[http://nodejs.org/api/all.html#all_global_objects]
===
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'global-member,
* cpt.ljnglobal-member,
* cpt.ljn'global-objects,
* cpt.ljnglobal-objects,
* cpt.ljn'globals,
* cpt.ljnglobals,
* ljn'global-member-cpt,
* ljnglobal-member-cpt,
* ljn'global-objects-cpt,
* ljnglobal-objects-cpt,
* ljn'globals-cpt,
* ljnglobals-cpt,
Name:
* cpt.ljn'ArrayBuffer,
* cpt.ljnArrayBuffer,
* ArrayBuffer-cpt,
* ljn'ArrayBuffer-cpt,
* ljnArrayBuffer-cpt,
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,
* cpt.ljnBuffer,
* 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
[http://nodejs.org/api/all.html#all_class_buffer_1]
===
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.
[http://nodejs.org/api/all.html#all_buffer]
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 36/147]
===
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.ljnconsole,
* cpt.ljn'console-object,
* cpt.ljnconsole-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.
[http://nodejs.org/api/all.html#all_process_1]
Name:
* cpt.ljn'process-object,
* cpt.ljn'process,
* cpt.ljnm.process,
* cpt.ljnmProcess,
* cpt.ljnglobal.process,
* cpt.ljnprocess,
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)
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.ljnpgm'command-line-arguments,
* cpt.ljnpgm'arguments,
* cpt.ljn'process.argv,
* cpt.ljn'process.argv-array,
* cpt.ljnprocess.argv,
* cpt.ljnprocess.argv-array,
* command-line-arguments-of-Node.js-program-cpt,
* ljnpgm'command-line-arguments-cpt,
* ljnpgm'arguments-cpt,
* ljn'process.argv-cpt,
* process.argv-cpt,
> 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'timers,
* cpt.ljntimers,
* cpt.ljn'timer-functions,
* cpt.ljntimer-functions,
* ljn'timers-cpt,
* ljntimers-cpt,
* ljn'timer-functions-cpt,
* ljntimer-functions-cpt,
Generic:
* ljs-phrase,
Name:
* cpt.ljn'phrase,
* cpt.ljnphrase,
* cpt.ljn'frs,
* cpt.ljnfrs,
* ljn'frs-cpt,
* ljnfrs-cpt,
* ljn'phrase-cpt,
* ljnphrase-cpt,
Generic:
* ljs-sentence,
Name:
* cpt.ljn'sentence,
* cpt.ljnsentence,
* cpt.ljn'stc,
* ljnstc-cpt,
* ljn'sentence-cpt,
* cpt.ljnsentence,
* ljn'stc-cpt,
* ljnstc-cpt,
Generic:
* ljs-root-tree,
Name:
* cpt.ljn'algo-root-tree,
* cpt.ljnalgo-root-tree,
* cpt.ljn-algo-root,
Description:
The-root-tree is the-main-module.
Name:
* cpt.ljn'algo.specific,
* cpt.ljnalgo.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'authentication,
* ljn'authentication-cpt,
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.ljnalgo.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]
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]
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,
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'library,
* cpt.ljnlibrary,
* cpt.ljn'lbr,
* cpt.ljnlbr,
* ljn'library-cpt,
* ljnlibrary-cpt,
* ljn'lbr-cpt,
* ljnlbr-cpt,
Generic:
* ljs-program,
Name:
* cpt.ljn'application,
* cpt.ljn'apn,
* cpt.ljn'code.application,
* cpt.ljn'program,
* cpt.ljn'pgm, {2016.06.21}
* cpt.ljnpgm, {2016.06.21}
* cpt.ljn'app,
* cpt.ljnapp,
* ljn'pgm-cpt,
* ljn-pgm-cpt,
* Node.js-application-cpt,
* Node.js-program-cpt,
* nodejs-application-cpt,
* nodejs-program-cpt,
* pgmNodejs-cpt,
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.ljnpgm'executing,
* cpt.ljnpgm-executing,
* ljnpgm'executing-cpt,
* ljnpgm-executing-cpt,
* node-app-running-cpt,
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.ljndbg,
* ljndbg-cpt,
AddressWpg:
* https://blog.risingstack.com/node-hero-node-js-debugging-tutorial/
Name:
* cpt.ljndebugger,
* 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.ljnpgm'deployment,
* cpt.ljn'hosting-application,
Resource:
* https://blog.risingstack.com/moving-node-js-from-paas-to-kubernetes-tutorial/,
Specific:
* AppFog,
* Coudnode,
* Nodejitsu,
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.ljnpgm.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]
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'desktop-program,
AddressWpg:
* http://code.tutsplus.com/tutorials/ introduction-to-html5-desktop-apps-with-node-webkit--net-36296,
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.ljnpgm.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.short:
A-Node.js-package is a-library or a-program with a-package.json-file.
[synagonism.2016-08-01]
Name:
* cpt.ljnnpm'package,
* cpt.ljn'package,
* cpt.ljnpackage,
* cpt.ljn'pkg,
* cpt.ljnpkg,
* ljn'package-cpt,
* ljnpkg-cpt,
* Node.js-package-cpt,
* npm-package-cpt,
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]
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.ljnpkgjsn,
* ljn'package.json-cpt,
* ljn'package.json-file-cpt,
* ljn'pkgjson-cpt,
* ljnpkgjsn-cpt,
* npm'package.json-cpt,
* package.json-cpt,
* package.json-file-cpt,
AddressWpg:
* https://www.npmjs.org/doc/files/package.json.html,
* https://docs.npmjs.com/getting-started/using-a-package.json
Name:
* cpt.ljnpkgjsn'field,
* cpt.ljnpkgjsn'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",
===
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": { "test" : "make test-cov" },
===
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 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 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:
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]
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.ljn'scoped-package,
* cpt.ljnpkg.scoped,
* scoped-package-cpt,
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.ljn'amdlc-package,
* cpt.ljnpkg.amdlc,
* amdlc-cpt,
Description.short:
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.ljn'browserify-module,
* cpt.ljnm.browserify,
* browserify-cpt,
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.ljnpkg.eslint,
* cpt.ljn'eslint-package,
* eslint-cpt,
* ESLint-cpt,
Generic:
* ljn-code-analysis-tool,
Description:
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/]
===
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/]
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]
Name:
* cpt.ljn'express,
* cpt.ljnexpress,
* cpt.ljnm.express,
* cpt.ljnlbr.express,
* express-nodejs-framework-cpt,
* express-library-cpt,
* expressjs-cpt,
* ljnexpress-cpt,
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.ljnpkg.jade,
* cpt.ljn'jade-package,
* jade-cpt,
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.ljnjake,
* cpt.ljnpkg.jake,
* cpt.ljn'jake-package,
* jake-cpt,
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.ljnjake'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.ljnjake'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:
* ljsdom-cpt,
* cpt.ljnpkg.jsdom,
* cpt.ljn'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.ljnpkg.jshint,
* cpt.ljn'jshint-package,
* jshint-cpt,
* JSHint-cpt,
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.ljnpkg.jslint,
* cpt.ljn'jslint-package,
* jslint-cpt,
* JSLint-cpt,
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.ljnpkg.moment,
* cpt.ljn'moment-package,
* momentjs-cpt,
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]
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.ljn'human,
* cpt.ljnhuman,
* cpt.ljnhmn,
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.ljnhmn.Dahl.Ryan,
* Dahl.Ryan-cpt,
* Ryan-Dahl-cpt,
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.ljnhmn.Caswell.Tim,
* Caswell.Time-cpt,
* Tim-Caswell-cpt,
Name:
* cpt.ljn'organization,
* cpt.ljnogn,
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]
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.ljnogn.Node.js-Foundation,
* cpt.ljn'Node.js-Foundation,
* Node.js-Foundation-cpt,
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,
* Node.js-relation-to-browser-javascript-cpt,
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,
* PHP-relation-to-nodejs-cpt,
Name:
* cpt.ljn'resource,
* cpt.ljnresource,
* cpt.ljnrsc,
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.ljntool,
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.ljntool.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.ljntool.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.ljneditor,
* cpt.ljnedr,
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.ljnversion-manager,
Specific:
* nvm-windows - Windows Only,
* nvmw - Windows Only,
* nodist - Windows Only,
* nvm - Mac/Linux Only,
* n - Mac/Linux Only,
Name:
* cpt.ljntool.testing,
* cpt.ljn'testing,
* cpt.ljntesting,
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.short:
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.ljnnpm,
* cpt.ljn'npm-tool,
* cpt.ljnnpm-tool,
* cpt.ljn'tool.npm,
* ljnnpm-cpt,
* node-package-manager-cpt,
* nodejs-package-manager-cpt,
* Node.js-package-manager-cpt,
* npm-cpt,
* npm-nodejs-package-manager-cpt,
* npm-package-manager-cpt,
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.ljnnpm'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.ljnnpm'command,
* cpt.ljnnpm'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]
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.ljnrpl,
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'Read-Eval-Print-Loop,
* cpt.ljnrepl,
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.ljninterpreter,
* cpt.ljnruntime,
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.ljnrtmopn,
* cpt.ljnrtm'option,
* cpt.ljnrtm'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]
Name:
* cpt.ljnrtmenv,
* cpt.ljnrtm'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,
* ljnevolution-cpt,
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,
* ljnversion-cpt,
resource:
* https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V6.md,
ljn.6.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.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.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.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.2013-03-28:
* changelog,
* 0.11.0 (unstable) - 0.11.14 (unstable),
ljn.0-10.2013-03-11:
* changelog,
* 0.10.0 (stable) - 0.10.46 (maintenance),
ljn.0-9.2012-07-20:
* changelog,
* 0.9.0 (unstable) - 0.9.12 (unstable),
ljn.0-8.2012-06-25:
* changelog,
* 0.8.0 (stable) - 0.8.25 (maintenance),
ljn.0-7.2012-01-16:
* changelog,
* 0.7.0 (unstable) - 0.7.12 (unstable),
ljn.0-6.2011-11-04:
* changelog,
* 0.6.0 (stable) - 0.6.20 (maintenance),
ljn.0-5.2011-07-05:
* changelog,
* 0.5.0 - 0.5.10,
ljn.0-4.2011-02-10:
* changelog,
* 0.4.0 - 0.4.12,
ljn.0-3.2010-10-23:
* changelog,
* 0.3.0 - 0.3.8,
ljn.0-2.2010-08-20:
* changelog,
* 0.2.0,
ljn.0-1.2009-06-30:
* changelog,
* 0.1.0 - 0.1.104,
ljn.0-0.2009-06-11:
* changelog,
0.0.3 - 0.0.6
Time: {2015}:
=== Node.js v4.0:
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]
Time: {2013}:
=== ISOMORPHIC-javascript:
In 2013, Airbnb was the first to use Node.js to provide isomorphic (also called universal or simply shared) javascript.
In the Node.js approach, the same framework is identically executed on the server side and client side.
On the server side, it provides an initial render of the page, and data could be provided through Node.js or through REST API calls.
On the client side, the framework binds to DOM elements, "rehydrates" (updates the initial server-side render provided by Node.js) the HTML, and makes asynchronous REST API calls whenever updated data is needed.
The biggest advantage Airbnb's javascript isomorphism had over Twitter's approach is the notion of a completely reusable rendering system.
Because the client-side framework is executed the same way on both server and client, rendering becomes much more manageable and debuggable in that the primary distinction between the server-side and client-side renders is not the language or templating system used, but rather what data is provisioned by the server and how.
From a prototype written in 10 days to being used across the stack by some of the largest websites in the world, long gone are the days of clunky browser implementations whose APIs changed depending on whether you were using Netscape or Internet Explorer.
It took javascript 20 years, but it is finally considered an equal partner to traditional, well-established server-side languages.
[http://buytaert.net/a-history-of-javascript-across-the-stack]
Time: {2009}:
=== Node.js:
Node.js was originally written in 2009 by Ryan Dahl.
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.
[https://en.wikipedia.org/wiki/Node.js#History]
Time: {2008}:
=== V8, PERFORMANCE:
In 2008, Google launched Chrome with a faster javascript engine called V8.
The release announcement read:
"We also built a more powerful javascript engine, V8, to power the next generation of web applications that aren't even possible in today's browsers.".
At the launch, V8 improved javascript performance by 10x over Internet Explorer by compiling javascript code to native machine code before executing it.
This caught my attention because I had recently finished my PhD thesis on the topic of JIT compilation.
More importantly, this marked the beginning of different browsers competing on javascript performance, which helped drive javascript's adoption.
[http://buytaert.net/a-history-of-javascript-across-the-stack]
Time: {2005}:
=== Google Maps, Ajax:
A year later in 2005, Google launched Google Maps, which used the same technology as Gmail to transform online maps into an interactive experience.
With Google Maps, Google was also the first large company to offer a javascript API for one of their services allowing developers to integrate Google Maps into their websites.
Google's XMLHttpRequest approach in Gmail and Google Maps ultimately came to be called Ajax (originally "Asynchronous javascript and XML").
Ajax described a set of technologies, of which javascript was the backbone, used to create web applications where data can be loaded in the background, avoiding the need for full page refreshes.
This resulted in a renaissance period of javascript usage spearheaded by open source libraries and the communities that formed around them, with libraries such as Prototype, jQuery, Dojo and Mootools.
(We added jQuery to Drupal core as early as 2006.)
[http://buytaert.net/a-history-of-javascript-across-the-stack]
Time: {2004}:
=== Gmail:
For the first 10 years of javascript's life, professional programmers denigrated javascript because its target audience consisted of "amateurs".
That changed in 2004 with the launch of Gmail.
Gmail was the first popular web application that really showed off what was possible with client-side javascript.
Competing e-mail services such as Yahoo! Mail and Hotmail featured extremely slow interfaces that used server-side rendering almost exclusively, with almost every action by the user requiring the server to reload the entire web page.
Gmail began to work around these limitations by using XMLHttpRequest for asynchronous data retrieval from the server.
Gmail's use of javascript caught the attention of developers around the world.
Today, Gmail is the classic example of a single-page javascript app; it can respond immediately to user interactions and no longer needs to make roundtrips to the server just to render a new page.
[http://buytaert.net/a-history-of-javascript-across-the-stack]
Time: {1995}:
=== ANNOUNCEMENT:
MOUNTAIN VIEW, Calif. (December 4, 1995) -- Netscape Communications Corporation (NASDAQ: NSCP) and Sun Microsystems, Inc. (NASDAQ:SUNW), today announced javascript, an open, cross-platform object scripting language for the creation and customization of applications on enterprise networks and the Internet. The javascript language complements Java, Sun's industry-leading object-oriented, cross-platform programming language. The initial version of javascript is available now as part of the beta version of Netscape Navigator 2.0, which is currently available for downloading from Netscape's web site.
[https://web.archive.org/.../wp.netscape.com/newsref/pr/newsrelease67.html]
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" or "words-of-name-cpt", 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.2.2016-08-04.last.minor: filCptLjs.html
• version.2.2016-08-04.last.minorNo (1-33): filCptLjs.2.2016-08-04.html (ljs, ljn)
• 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.created: lngJs.1.2016-05-10.html (ljb)
This page was visited times since {2016.05.04}
Page-path: javascript (ljs) ∈ modelInfoWorld ∈ hitp ∈ synagonism.net