Socket
Book a DemoInstallSign in
Socket

@bconnorwhite/module

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bconnorwhite/module

Read your module's package.json without importing it

latest
Source
npmnpm
Version
2.0.2
Version published
Maintainers
1
Created
Source

@bconnorwhite/module

npm typescript GitHub stars Twitter Follow

Read your module's package.json without importing it.

Why not just import your package.json? Importing your package.json can break your project's structure when using TypeScript if package.json is outside of your source folder.

Installation

yarn add @bconnorwhite/module
npm install @bconnorwhite/module

API

import {
  PackageJSON,
  getPackageJSON,
  getPackageJSONSync,
  getVersion,
  getVersionSync
} from "@bconnorwhite/module";

function getPackageJSON(dirname: string): Promise<PackageJSON | undefined>;

function getPackageJSONSync(dirname: string): PackageJSON | undefined;

function getVersion(dirname: string): Promise<string | undefined>;

function getVersionSync(dirname: string): string | undefined;

Dependenciesdependencies

  • find-up: Find a file or directory by walking up parent directories
  • read-json-safe: Read objects from JSON files without try catch.
  • types-pkg-json: Type checking for package.json

Dev DependenciesDavid


License license

MIT


  • @bconnorwhite/package: A utility for reading package.json of a project, and forming paths relative to it.

Keywords

version

FAQs

Package last updated on 09 Sep 2020

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