npm install --save @thebespokepixel/meta
Import (or require) the module…
import {dirname} from 'node:path'
import {fileURLToPath} from 'node:url'
import meta from '@thebespokepixel/meta'
const metadata = meta(dirname(fileURLToPath(import.meta.url))) // Start searching from inside this scripts module
Look up the file system hierarchy, starting from the current working directory or provided path for a package file and return specific package metadata as a sanitised map.
Creates the metadata collection function, starting at the path provided or the current working directory by default.
(string)
The directory to start searching for a package.json file.
metadata
:
The map of reduced package metadata.
Extract metadata for sharing inside a package.
Type: metadata
(string)
: The package's name
(string)
: The CLI binary we provide
(string)
: The description from package.json
(string)
: Copyright info from package.json
(string)
: The package license
(string)
: Our issues queue
(string)
: Declared package binaries