Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pkginfo

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pkginfo

An easy way to expose properties on a module from a package.json

  • 0.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8M
increased by14.05%
Maintainers
1
Weekly downloads
 
Created

What is pkginfo?

The 'pkginfo' npm package allows you to retrieve information from a package.json file in a Node.js project. It is useful for accessing metadata such as the version, author, and dependencies of a package programmatically.

What are pkginfo's main functionalities?

Retrieve package information

This feature allows you to retrieve and log the package information from the package.json file. By requiring 'pkginfo' and passing 'module' to it, the package information is attached to the module.exports object.

const pkginfo = require('pkginfo')(module);
console.log(module.exports);

Retrieve specific fields

This feature allows you to retrieve specific fields from the package.json file. In this example, only the 'version' and 'author' fields are retrieved and logged.

const pkginfo = require('pkginfo')(module, 'version', 'author');
console.log(module.exports);

Other packages similar to pkginfo

Keywords

FAQs

Package last updated on 23 Aug 2017

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