Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

naked-objects

0.1.1 • Public • Published

naked-objects

Shorthand notation for Object.create(null) via node module hook

NPM

Build status dependencies devdependencies

endorse

naked-objects installs a Node loader hook that transforms each loaded JavaScript file and expands <> syntax into Object.create(null)

var foo = <>;
foo.bar = 'bar'; // use just like normal objects

Because naked objects do not inherit from Object, there are no weird cases like

{} + {}     // NaN
var foo = <>;
foo + foo   // TypeError: Cannot convert object to primitive value

why?

Sweet naked objects

Small print

Author: Gleb Bahmutov © 2014

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

install

npm i naked-objects

Downloadsweekly downloads

12

version

0.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability