1.0.0 • Published 8 years ago

pkg-json-info-dict v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
8 years ago

Given an array of filesystem paths, gives back a data structure describing the npm project(s) in each path.

Install: npm i pkg-json-info-dict -S

Usage (asynchronously performs all filesystem operations):

var readPkgJSONInfoDict = require('pkg-json-info-dict').readPkgJSONInfoDict;
var paths = [ '/abs/path/to/file1', '/abs/path/to/file2' ];
readPkgJSONInfoDict(paths, (err, result) => {
 // here result is of type PkgJSONInfoDict
});

Usage (synchronously performs all filesystem operations):

var readPkgJSONInfoDictSync = require('pkg-json-info-dict').readPkgJSONInfoDictSync;
var paths = [ '/abs/path/to/file1', '/abs/path/to/file2' ];
var result = readPkgJSONInfoDictSync(paths);
// result is of type PkgJSONInfoDict

Type PkgJSONInfoDict:

// An Object whose keys are of type PkgJSONInfo.
// The keys themselves are the names of each package.
export interface PkgJSONInfoDict {
  [el: string]: PkgJSONInfo;
}

export interface PkgJSONInfo {
  // the absolute path to the directory holding the package.json file
  absPath: string;
  // the parsed contents of a package.json file
  pkgJSON: PkgJSON;
}

export interface PkgJSON {
  name: string;
  version: string;
  dependencies?: { [el: string]: string };
  peerDependencies?: { [el: string]: string };
  devDependencies?: { [el: string]: string };
}
1.0.0

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago