Comparing version 0.7.8 to 0.7.9
21
index.js
@@ -16,11 +16,22 @@ 'use strict'; | ||
/** | ||
* Create an instance of `Base` with `options`. | ||
* Create an instance of `Base` with `config` and `options`. | ||
* | ||
* ```js | ||
* var app = new Base(); | ||
* var app = new Base({baz: 'qux'}, {yeah: 123, nope: 456}); | ||
* | ||
* app.set('foo', 'bar'); | ||
* console.log(app.get('foo')); | ||
* //=> 'bar' | ||
* | ||
* console.log(app.get('foo')); //=> 'bar' | ||
* console.log(app.get('baz')); //=> 'qux' | ||
* console.log(app.get('yeah')); //=> undefined | ||
* | ||
* console.log(app.foo); //=> 'bar' | ||
* console.log(app.baz); //=> 'qux' | ||
* console.log(app.yeah); //=> undefined | ||
* | ||
* console.log(app.options.yeah); //=> 123 | ||
* console.log(app.options.nope); //=> 456 | ||
* ``` | ||
* | ||
* @param {Object} `config` passed to [cache-base][] | ||
* @param {Object} `options` | ||
@@ -32,3 +43,3 @@ * @api public | ||
if (!(this instanceof Base)) { | ||
return new Base(config); | ||
return new Base(config, options); | ||
} | ||
@@ -35,0 +46,0 @@ Cache.call(this, config); |
{ | ||
"name": "base", | ||
"description": "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.", | ||
"version": "0.7.8", | ||
"version": "0.7.9", | ||
"homepage": "https://github.com/node-base/base", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
@@ -75,8 +75,9 @@ # base [![NPM version](https://img.shields.io/npm/v/base.svg)](https://www.npmjs.com/package/base) [![Build Status](https://img.shields.io/travis/node-base/base.svg)](https://travis-ci.org/node-base/base) | ||
### [Base](index.js#L29) | ||
### [Base](index.js#L40) | ||
Create an instance of `Base` with `options`. | ||
Create an instance of `Base` with `config` and `options`. | ||
**Params** | ||
* `config` **{Object}**: passed to [cache-base](https://github.com/jonschlinkert/cache-base) | ||
* `options` **{Object}** | ||
@@ -87,9 +88,19 @@ | ||
```js | ||
var app = new Base(); | ||
var app = new Base({baz: 'qux'}, {yeah: 123, nope: 456}); | ||
app.set('foo', 'bar'); | ||
console.log(app.get('foo')); | ||
//=> 'bar' | ||
console.log(app.get('foo')); //=> 'bar' | ||
console.log(app.get('baz')); //=> 'qux' | ||
console.log(app.get('yeah')); //=> undefined | ||
console.log(app.foo); //=> 'bar' | ||
console.log(app.baz); //=> 'qux' | ||
console.log(app.yeah); //=> undefined | ||
console.log(app.options.yeah); //=> 123 | ||
console.log(app.options.nope); //=> 456 | ||
``` | ||
### [.is](index.js#L86) | ||
### [.is](index.js#L97) | ||
@@ -120,3 +131,3 @@ Set the given `name` on `app._name` and `app.is*` properties. Used for doing lookups in plugins. | ||
### [.isRegistered](index.js#L129) | ||
### [.isRegistered](index.js#L143) | ||
@@ -155,3 +166,3 @@ Returns true if a plugin has already been registered on an instance. | ||
### [.assertPlugin](index.js#L156) | ||
### [.assertPlugin](index.js#L170) | ||
@@ -175,3 +186,3 @@ Throws an error when plugin `name` is not registered. | ||
### [.use](index.js#L180) | ||
### [.use](index.js#L194) | ||
@@ -198,3 +209,3 @@ Define a plugin function to be called immediately upon init. Plugins are chainable and the only parameter exposed to the plugin is the application instance. | ||
### [.lazy](index.js#L205) | ||
### [.lazy](index.js#L219) | ||
@@ -220,3 +231,3 @@ Lazily invoke a registered plugin. **Note** that this method can only be used with: | ||
### [.define](index.js#L237) | ||
### [.define](index.js#L251) | ||
@@ -244,3 +255,3 @@ Define a non-enumerable property on the instance. Dot-notation is **not supported** with `define`. | ||
### [.mixin](index.js#L256) | ||
### [.mixin](index.js#L270) | ||
@@ -258,3 +269,3 @@ Mix property `key` onto the Base prototype. If base-methods | ||
### [.use](index.js#L278) | ||
### [.use](index.js#L292) | ||
@@ -278,3 +289,3 @@ Static method for adding global plugin functions that will be added to an instance when created. | ||
### [.extend](index.js#L290) | ||
### [.extend](index.js#L304) | ||
@@ -285,3 +296,3 @@ Static method for inheriting both the prototype and | ||
### [.Base.mixin](index.js#L328) | ||
### [.Base.mixin](index.js#L342) | ||
@@ -305,3 +316,3 @@ Static method for adding mixins to the prototype. When a function is returned from the mixin plugin, it will be added to an array so it can be used on inheriting classes via `Base.mixins(Child)`. | ||
### [.Base.mixins](index.js#L349) | ||
### [.Base.mixins](index.js#L363) | ||
@@ -321,3 +332,3 @@ Static method for running currently saved global mixin functions against a child constructor. | ||
### [.inherit](index.js#L361) | ||
### [.inherit](index.js#L375) | ||
@@ -331,6 +342,6 @@ Similar to `util.inherit`, but copies all static properties, | ||
``` | ||
Statements : 100% ( 107/107 ) | ||
Branches : 100% ( 29/29 ) | ||
Functions : 100% ( 22/22 ) | ||
Lines : 100% ( 106/106 ) | ||
Statements : 100% ( 109/109 ) | ||
Branches : 100% ( 27/27 ) | ||
Functions : 100% ( 23/23 ) | ||
Lines : 100% ( 108/108 ) | ||
``` | ||
@@ -402,2 +413,2 @@ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on February 23, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on February 24, 2016._ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27591
385
399