cellium v1.2.28
Cellium
Cellium is a simple namespace implementation package.
Installation
$ npm install cellium
Starting
The Cellium module can be required as a regular NPM package, and must be assigned to an identifier (of any type).
const Cellium = require('cellium');
Creating a namespace
The namespaces are created as objects, labeled with Namespace
class tag.
You can create a namespace using:
let foo = Cellium.create('foo');
// console.log(foo) will result in:
// Namespace {}
Extending namespaces
It is possible to extend the namespaces by adding new key-value properties to it:
Cellium.extend(foo, [
{path: 'propA', data: [1, 2, 3]},
{path: 'propB', data: 'abc'},
{path: 'propC.propC1', data: (a, b) => a + b},
{path: 'propC.propC2', data: function(a, b) {return a - b}},
{path: 'propD', data: {}}
]);
/* Expect foo to be:
Namespace {
propA: [1, 2, 3],
propB: 'abc',
propC: {
propC1: (a, b) => a + b,
propC2: function(a, b) { return a - b}
},
propD: {}
}
*/
More Information
You can check the documentation here for the complete information about the package.
Find the package in NPM here, or test it at NPM RunKit.
Support and Contributions
To report bugs and problems, or if you have an idea on how to improve this package, and want to share it, just make a pull request on GitHub. (For major changes, please open an issue first.)
License
MIT-Licensed.
See LICENSE for details.
4 months ago
4 months ago
5 months ago
10 months ago
6 months ago
6 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago