Socket
Socket
Sign inDemoInstall

use

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

23

index.js

@@ -10,11 +10,10 @@ /*!

var isObject = require('isobject');
var define = require('define-property');
var typeOf = require('kind-of');
module.exports = function base(app, options) {
if (!isObject(app) && typeof app !== 'function') {
if (typeOf(app) !== 'object' && typeof app !== 'function') {
throw new TypeError('expected an object or function');
}
var opts = isObject(options) ? options : {};
var opts = typeOf(options) === 'object' ? options : {};
var prop = typeof opts.prop === 'string' ? opts.prop : 'fns';

@@ -72,3 +71,3 @@ if (!Array.isArray(app[prop])) {

define(app, 'run', function(val) {
if (!isObject(val)) return;
if (typeOf(val) !== 'object') return;

@@ -101,7 +100,7 @@ if (!val.use || !val.run) {

function use(type, fn, options) {
var idx = 1;
var offset = 1;
if (typeof type === 'string' || Array.isArray(type)) {
fn = wrap(type, fn);
idx++;
offset++;
} else {

@@ -119,3 +118,3 @@ options = fn;

var args = [].slice.call(arguments, idx);
var args = [].slice.call(arguments, offset);
args.unshift(self);

@@ -151,1 +150,9 @@

};
function define(obj, key, val) {
Object.defineProperty(obj, key, {
configurable: true,
writable: true,
value: val
});
}
{
"name": "use",
"description": "Easily add plugin support to your node.js application.",
"version": "3.0.0",
"version": "3.1.0",
"homepage": "https://github.com/jonschlinkert/use",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"<wtgtybhertgeghgtwtg@gmail.com> (https://github.com/wtgtybhertgeghgtwtg)",
"Brian Woodward <brian.woodward@gmail.com> (https://twitter.com/doowb)",
"Charlike Mike Reagent (https://i.am.charlike.online)",
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)"
"Brian Woodward (https://twitter.com/doowb)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
"Olsten Larck (https://i.am.charlike.online)",
"(https://github.com/wtgtybhertgeghgtwtg)"
],

@@ -29,14 +29,14 @@ "repository": "jonschlinkert/use",

"dependencies": {
"define-property": "^0.2.5",
"isobject": "^3.0.0"
"kind-of": "^6.0.2"
},
"devDependencies": {
"base-plugins": "^1.0.0",
"extend-shallow": "^2.0.1",
"define-property": "^2.0.0",
"extend-shallow": "^3.0.1",
"gulp": "^3.9.1",
"gulp-eslint": "^3.0.1",
"gulp-format-md": "^0.1.12",
"gulp-istanbul": "^1.1.1",
"gulp-mocha": "^3.0.0",
"mocha": "^3.2.0"
"gulp-eslint": "^4.0.0",
"gulp-format-md": "^1.0.0",
"gulp-istanbul": "^1.1.2",
"gulp-mocha": "^3.0.1",
"mocha": "^4.0.1"
},

@@ -43,0 +43,0 @@ "keywords": [

@@ -1,5 +0,7 @@

# use [![NPM version](https://img.shields.io/npm/v/use.svg?style=flat)](https://www.npmjs.com/package/use) [![NPM monthly downloads](https://img.shields.io/npm/dm/use.svg?style=flat)](https://npmjs.org/package/use) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/use.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/use)
# use [![NPM version](https://img.shields.io/npm/v/use.svg?style=flat)](https://www.npmjs.com/package/use) [![NPM monthly downloads](https://img.shields.io/npm/dm/use.svg?style=flat)](https://npmjs.org/package/use) [![NPM total downloads](https://img.shields.io/npm/dt/use.svg?style=flat)](https://npmjs.org/package/use) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/use.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/use)
> Easily add plugin support to your node.js application.
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
## Install

@@ -25,23 +27,23 @@

### Related projects
<details>
<summary><strong>Contributing</strong></summary>
* [base-plugins](https://www.npmjs.com/package/base-plugins): Adds 'smart plugin' support to your base application. | [homepage](https://github.com/node-base/base-plugins "Adds 'smart plugin' support to your base application.")
* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality node.js applications, using plugins like building blocks")
* [ware](https://www.npmjs.com/package/ware): Easily create your own middleware layer. | [homepage](https://github.com/segmentio/ware "Easily create your own middleware layer.")
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributing
</details>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
<details>
<summary><strong>Running Tests</strong></summary>
### Contributors
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
| **Commits** | **Contributor** |
| --- | --- |
| 27 | [jonschlinkert](https://github.com/jonschlinkert) |
| 7 | [tunnckoCore](https://github.com/tunnckoCore) |
| 2 | [doowb](https://github.com/doowb) |
| 2 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
```sh
$ npm install && npm test
```
### Building docs
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

@@ -55,10 +57,21 @@

### Running tests
</details>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
### Related projects
```sh
$ npm install && npm test
```
You might also be interested in these projects:
* [base-plugins](https://www.npmjs.com/package/base-plugins): Adds 'smart plugin' support to your base application. | [homepage](https://github.com/node-base/base-plugins "Adds 'smart plugin' support to your base application.")
* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks")
* [ware](https://www.npmjs.com/package/ware): Easily create your own middleware layer. | [homepage](https://github.com/segmentio/ware "Easily create your own middleware layer.")
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 33 | [jonschlinkert](https://github.com/jonschlinkert) |
| 7 | [charlike-old](https://github.com/charlike-old) |
| 2 | [doowb](https://github.com/doowb) |
| 2 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
### Author

@@ -68,2 +81,3 @@

* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)
* [github/jonschlinkert](https://github.com/jonschlinkert)

@@ -79,2 +93,2 @@ * [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 12, 2017._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 03, 2017._

Sorry, the diff of this file is not supported yet

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