Socket
Socket
Sign inDemoInstall

basespace

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    basespace

Functions to create namespaces inside objects


Version published
Weekly downloads
5
increased by150%
Maintainers
1
Install size
240 kB
Created
Weekly downloads
 

Changelog

Source

0.1.0 / 2015-01-10

  • migration to Component 1.0

Readme

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

Last updated on 09 Jan 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc