1.2.28 • Published 4 months ago

cellium v1.2.28

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Cellium

Cellium is a simple namespace implementation package.

npm status

Install Size

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.

1.2.27

4 months ago

1.2.28

4 months ago

1.2.26

5 months ago

1.2.23

10 months ago

1.2.24

6 months ago

1.2.25

6 months ago

1.2.22

11 months ago

1.2.21

12 months ago

1.2.18

1 year ago

1.2.19

1 year ago

1.2.20

1 year ago

1.2.17

1 year ago

1.2.13

1 year ago

1.2.16

1 year ago

1.2.14

1 year ago

1.2.15

1 year ago

1.2.11

1 year ago

1.2.0

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.9

1 year ago

1.2.10

1 year ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago