littlefinger

3.0.1 • Public • Published

littlefinger ☝️

Extend and compose package.json by pointing at multiple remotes

npm i littlefinger

on NPM

tldr;

Create this

{
  "dependencies": {
    "ramda": "^0.25.0",
    "superagent": "^3.8.2"
  },
  "devDependencies": {
    "eslint": "^4.15.0",
    "eslint-config-airbnb-base": "^12.1.0",
    "eslint-plugin-import": "^2.8.0"
  }
}

From these

With this setup

const littlefinger = require('littlefinger');
 
const dependencies = {
  eslint:
    'https://raw.githubusercontent.com/cmswalker/littlefinger/master/fixtures/remotes-eslint.json',
  functional:
    'https://raw.githubusercontent.com/cmswalker/littlefinger/master/fixtures/remotes-functional.json',
  http:
    'https://raw.githubusercontent.com/cmswalker/littlefinger/master/fixtures/remotes-http.json',
};
 
const output = './simple.package.json';
 
// The types of dependencies you wish to gather
const types = { dependencies: true, devDependencies: true, peerDependencies: false };
 
littlefinger.build({
  dependencies, output, types,
}).catch(console.log);

Usage

Examples

const littlefinger = require('littlefinger');
 
// Lets create a package.json that combines dependencies from these 3 remote urls
// NOTE: you can view them here https://github.com/cmswalker/littlefinger/tree/master/fixtures
 
const dependencies = {
  eslint:
    'https://raw.githubusercontent.com/cmswalker/littlefinger/master/fixtures/remotes-eslint.json',
  functional:
    'https://raw.githubusercontent.com/cmswalker/littlefinger/master/fixtures/remotes-functional.json',
  http:
    'https://raw.githubusercontent.com/cmswalker/littlefinger/master/fixtures/remotes-http.json',
};
 
const output = './simple.package.json';
 
// Choose to ignore packages found in dependencies
const blacklist = ['eslint-plugin-import'];
 
// Enables logging to console instead of writing to filesystem
const dryrun = false;
 
// The types of dependencies you wish to gather
const types = { dependencies: true, devDependencies: true, peerDependencies: false };
 
// NOTE: littlefinger takes the latest package version by default if duplicates are found
 
littlefinger.build({
  dependencies, output, types, blacklist, dryrun,
}).catch(console.log);
 
// The result can be found @ https://github.com/cmswalker/littlefinger/blob/master/examples/simple.package.json

Package Sidebar

Install

npm i littlefinger

Weekly Downloads

0

Version

3.0.1

License

MIT

Last publish

Collaborators

  • cmswalker