Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

namespacerjs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

namespacerjs

Utility for quick namespacing objects

  • 0.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Namespacer.js

A simple library for creating namespaces in the browser


	// Create the namespace
	Namespacer('foo.bar.baz')

	// Use the namespace
	foo.bar.baz = {
		a: 1
	}

	// Pass an object directly
	Namespacer('foo.bar.baz', {
		a: 1
	})''

	// Retrieve an object from a namespace, if it doesn't exist it will just return an empty object
	var a = Namespacer('foo.bar.baz');

Namespacer takes care of not replacing existing objects.

Install

npm install namespacerjs

Test

webpack
Open test/index.html in a browser

or

npm test

Build

npm install
webpack

Keywords

FAQs

Package last updated on 27 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc