2.0.0 • Published 10 months ago

get-package-json-file v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

get-package-json-file

DOWNLOADS Node.js CLI Learn VSCode Sponsor Follow @MrAhmadAwais on Twitter

Read a package json file

šŸ“Ÿ

Install

pnpm install get-package-json-file
# OR
npm install get-package-json-file
# OR
yarn add get-package-json-file

āš™ļø

Usage

// Use ESM `import` statement syntax.
import getPackageJson from 'get-package-json-file';

// OR use CommonJS `require` syntax.
const getPackageJson = require('get-package-json-file');


// Get the package.json of the current working directory.
const pkgJson = await getPackageJson();

// This is same as.
const pkgJson = await getPackageJson(`./package.json`);

// Get the package.json of a specific directory e.g. one level up.
const pkgJson = await getPackageJson(`./../package.json`);

šŸ“ƒ

API

getPackageJson(input)

āÆ input

Path to the package.json file as a string.

Type: string Default: ./package.json (optional)

You can specify the options below.

šŸ“

Changelog

āÆ Read the changelog here →

KEY: šŸ“¦ NEW, šŸ‘Œ IMPROVE, šŸ› FIX, šŸ“– DOC, šŸš€ RELEASE, and šŸ¤– TEST

I use Emoji-log, you should try it and simplify your git commits.

šŸ“ƒ

License & Conduct

šŸ™Œ

Connect

šŸ‘Œ

Sponsor

Me (Ahmad Awais) and my incredible wife (Maedah Batool) are two engineers who fell in love with open source and then with each other. You can read more about me here. If you or your company use any of my projects or like what I’m doing then consider backing me. I'm in this for the long run. An open-source developer advocate.

Ahmad on Twitter

NodeCLI.com — Learn to build Node.js CLI Automation

This repository is part of the NodeCLI.com course.

After building hundreds of developer automation tools used by millions of developers, I am sharing exactly how you can do it yourself with minimum effective effort. Learn to build Node.js & JavaScript based CLI (Command Line Interface) apps. Automate the grunt work, do more in less time, impress your manager, and help the community. → I'm sharing it all in this online video course. Node CLI Automation without wasting a 1,000 hours →

Node CLI Course

Node CLI

Awais on Twitter