Socket
Socket
Sign inDemoInstall

father

Package Overview
Dependencies
Maintainers
1
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

father

A package parser that can resolve self and dependencies, supporting spm, component.


Version published
Weekly downloads
6.4K
decreased by-2.44%
Maintainers
1
Weekly downloads
 
Created
Source

father Build Status Coverage Status

A package parser that can resolve self and dependencies, supporting spm/component.


Install

$ npm install father -g

Usage

var Package = require('father').ComponentPackage;
var pkg = new Package('path/to/package')
console.log(pkg.name);
console.log(pkg.version);
console.log(pkg.main);
console.log(pkg.dependencies); // return a object contains dependencies
console.log(pkg.get('each')); // return a package named each

Custom

If you want to use it for your package, you can extend Package and override readPackage.

var Package = require('father').Package;
var Custom = Package.extend({
  readPackage: function() {
    // read config file, E.g. component.json
    // return a package contains id, name, version, dependencies, main, dest, files, origin
    // dependencies should contain id, dest
  };
})

Example for returned object by readPackage

{
  id: 'a',
  name: 'a'
  version: '1.0.0',
  main: 'index.js',
  dest: '/home/user/a',
  dependencies: {
    b: {
      id: 'b',
      dest: '/home/user/a/components/b'
    }
  }
}

Files

pkg.files contains export files and it's dependencies in your module.

Example below

{
  files: {
    'index.js': ['each', './feature']
  }
}

LISENCE

Copyright (c) 2014 popomore. Licensed under the MIT license.

FAQs

Package last updated on 19 Mar 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

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