bare-objects

0.2.0 • Public • Published

bare-objects

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

NPM

Build status dependencies devdependencies

endorse

bare-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 bare 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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    9
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    9

Package Sidebar

Install

npm i bare-objects

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • bahmutov