Socket
Socket
Sign inDemoInstall

mos-read-pkg-up

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

mos-read-pkg-up

Read the closest package.json file


Version published
Weekly downloads
6
decreased by-99.26%
Maintainers
1
Install size
365 kB
Created
Weekly downloads
 

Readme

Source

mos-read-pkg-upBuild status for master

Read the closest package.json file

Why

Installation

This module is installed via npm:

npm install mos-read-pkg-up --save

Usage

const readPkgUp = require('mos-read-pkg-up');

readPkgUp().then(result => {
	console.log(result);
	//> { pkg:
	//     { name: 'mos-read-pkg-up',
	//       version: '1.0.2',
	//       description: 'Read the closest package.json file',
	//       license: 'MIT',
	//       repository:
	//        { type: 'git',
	//          url: 'git+ssh://git@github.com/zkochan/read-pkg-up.git' },
	//       author:
	//        { name: 'Sindre Sorhus',
	//          email: 'sindresorhus@gmail.com',
	//          url: 'sindresorhus.com' },
	//       engines: { node: '>=0.10.0' },
	//       scripts: { test: 'xo && ava', md: 'mos' },
	//       files: [ 'index.js' ],
	//       keywords:
	//        [ 'json',
	//          'read',
	//          'parse',
	//          'file',
	//          'fs',
	//          'graceful',
	//          'load',
	//          'pkg',
	//          'package',
	//          'find',
	//          'up',
	//          'find-up',
	//          'findup',
	//          'look-up',
	//          'look',
	//          'file',
	//          'search',
	//          'match',
	//          'package',
	//          'resolve',
	//          'parent',
	//          'parents',
	//          'folder',
	//          'directory',
	//          'dir',
	//          'walk',
	//          'walking',
	//          'path' ],
	//       dependencies: { 'mos-read-pkg': '^1.1.2', 'find-up': '^1.0.0' },
	//       devDependencies: { ava: '*', mos: '^0.16.0', xo: '*' },
	//       bugs: { url: 'https://github.com/zkochan/read-pkg-up/issues' },
	//       readme: 'ERROR: No README data found!',
	//       homepage: 'https://github.com/zkochan/read-pkg-up#readme',
	//       _id: 'mos-read-pkg-up@1.0.2' },
	//    path: '/home/zoltan/src/read-pkg-up/package.json' }
});

API

readPkgUp([options])

Returns a promise for the result object.

readPkgUp.sync([options])

Returns a result object.

options
cwd

Type: string
Default: .

Directory to start looking for a package.json file.

normalize

Type: boolean
Default: true

Normalize the package data.

  • read-pkg - Read a package.json file
  • pkg-up - Find the closest package.json file
  • find-up - Find a file by walking up parent directories
  • pkg-conf - Get namespaced config from the closest package.json

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 13 Jun 2016

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc