magic-object
v1.1.0
Published
```bash npm install magic-object ```
Downloads
3
Readme
Javascrpit magic object library
Install
npm install magic-object
Usage
const MagicObject = require('magic-object');
const magicObject = new MagicObject((path, args) => {
return {path, args};
});
console.log(magicObject.foo.bar(1)); // output: {path: ['foo', 'bar'], args: [1]}
Or Async usage
const magicObject = new MagicObject(async (path, args) => {
return {path, args};
});
console.log(await magicObject.foo.bar(1)); // output: {path: ['foo', 'bar'], args: [1]}