Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

context-manager

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

context-manager

Manage context for templates.

Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

context-manager NPM version

Manage context for templates.

Install

Install with npm

npm i context-manager --save

Usage

var context = require('context-manager');

API

Context

Create an instance of Context.

add

Add a context level, optionally passing a value to start with.

  • type {String}: The kind of context to add.
  • level {Number}: Numerical value representing the order in which this level should be merged versus other levels.
  • value {Object}: Optionally pass a starting object.
context.add('locals', {a: 'b'});

get

Return the context for type.

  • type {String}: The context type to get.
  • returns: {*}
context.set('a', {a: 'b'});
context.get('a');
// => {a: 'b'}

setLevel

Set the level (number) for the specified context type.

  • type {String}: The context type to get.
  • returns {Number} num
context.set('a', {a: 'b'});
context.get('a');
// => {a: 'b'}

getLevel

Get the level (number) for the specified context type.

  • type {String}: The context type to get.
  • returns: {Number}
context.setLevel('a', 1);
context.getLevel('a');
// => '1'

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license

This file was generated by verb-cli on August 12, 2014.

Keywords

context

FAQs

Package last updated on 13 Aug 2014

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