lodash-namespace
A lodash mixin for namespacing objects
This module has a very simple purpose, which is to namespace an object at varying
Install
$ npm install --save lodash-namespace
Usage
var _ = ; // or, providing your own lodash objectvar _ = ; var myObj = {}; var myNamespace = _;//=> {}console;//=> {hello: {world: {}}} console;//=> true // Or, you can use it to namespace lodash itself, or a wrapped object var myNamespace = ;//=> {}console;//=> {hello: {world: {}}} var myNamespace = _;//=> {} console;//=> {world: {}}
API
_.namespace(obj, path);
If obj
is not provided, it will use either lodash itself, or if it's a wrapped object, it will use that object.
path
can be any value that you would be able to pass to get or set.
License
MIT © Nate Cavanaugh