Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/debitoor/parse-dependencies
https://github.com/debitoor/parse-dependencies
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/debitoor/parse-dependencies
- Owner: debitoor
- License: mit
- Created: 2015-08-12T08:14:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-21T13:06:18.000Z (over 7 years ago)
- Last Synced: 2024-10-02T11:15:49.690Z (about 2 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 26
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parse-dependencies
Fast and easy way to get dependencies for your code.[![npm version](https://badge.fury.io/js/@debitoor/parse-dependencies.svg)](http://badge.fury.io/js/@debitoor/parse-dependencies) [![Build Status](https://travis-ci.org/debitoor/parse-dependencies.svg?branch=master)](https://travis-ci.org/debitoor/parse-dependencies) [![Dependency Status](https://david-dm.org/debitoor/parse-dependencies.svg)](https://david-dm.org/debitoor/parse-dependencies) [![devDependency Status](https://david-dm.org/debitoor/parse-dependencies/dev-status.svg)](https://david-dm.org/debitoor/parse-dependencies#info=devDependencies) [![Coverage Status](https://coveralls.io/repos/debitoor/parse-dependencies/badge.svg?branch=master&service=github)](https://coveralls.io/github/debitoor/parse-dependencies?branch=master)
## Install
npm i -SE @debitoor/parse-dependencies## Usage
```js
const parse = require('@debitoor/parse-dependencies');
parse(__dirname + '/server.js', function (err, deps) {
console.log(deps); // 'express', 'body-parser' ...
});
```You can compare result with you production dependencies
```js
const parse = require('@debitoor/parse-dependencies');
const packageDeps = require('./package').dependencies;parse(__dirname + '/server.js', function (err, deps) {
const diff = deps.filter(function (item) {
return !(item in packageDeps);
});
if (diff.length) {
console.log('oops. You have missing depencies\n%s', diff.join());
}
});
```