New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

basespace

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basespace

Functions to create namespaces inside objects

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

basespace

Functions to create namespaces inside objects.

Installation

Node

npm install basespace

Component

component install gamtiq/basespace

Jam

jam install basespace

Bower

bower install basespace

SPM

spm install numgen

AMD, script tag

Use dist/basespace.js or dist/basespace.min.js (minified version).

Usage

Node, Component, SPM

var ns = require("basespace");
...

Jam

require(["basespace"], function(ns) {
    ...
});

AMD

define(["path/to/dist/basespace.js"], function(ns) {
    ...
});

Bower, script tag

<!-- Use bower_components/basespace/dist/basespace.js if the library was installed via Bower -->
<script type="text/javascript" src="path/to/dist/basespace.js"></script>
<script type="text/javascript">
    // basespace is available via basespace field of window object
    var ns = basespace;
    ...
</script>

Example

var app = {
    space: ns.space
};
ns(["model", "ui.dialog", "ui.list", "ui.list.cyclic", "util"], app);
app.space("ui.menu", "template");
app.space("data").util = {...};

API

ns(namespaces: Array|String, [context: Object], [value])

Create specified namespaces inside context if they do not exist. context is global object (i.e. window in browser) by default. value specifies a value that will be assigned to a final field. {} by default.

Return the value for the last of created names/fields.

.space(namespace: String, ...)

Create the specified namespace inside this object.

Return the value for the last of created names/fields.

Licence

MIT

Keywords

FAQs

Package last updated on 09 Jan 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