MCPcopy Index your code
hub / github.com/abraham/pkg-ok

github.com/abraham/pkg-ok @v4.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.0.0 ↗ · + Follow
15 symbols 55 edges 10 files 0 documented · 0% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

pkg-ok Build status npm

pkg-ok checks paths and scripts defined in package.json before you publish 👌

  • Ensures paths defined in main, bin, module, types, typings, es2015, browser, and exports exist
  • Ensures paths defined in main, bin, and browser are relative
  • Ensures bin scripts use cross-platform line endings

Usage

npm install pkg-ok --save-dev
// package.json
{
  "main": "oops_this_file_doesnt_exist.js",
  "scripts": {
    "prepublishOnly": "... && pkg-ok"
  }
}
npm publish
# Error!
# Since main file doesn't exist, publish is blocked

CLI

Check the package.json in the current directory.

pkg-ok

Check the package.json in a specific directory.

pkg-ok some/directory

Check additional package.json fields or bin files.

pkg-ok --field someField --bin script.sh

API

const pkgDirectory = __dirname;

pkgOk(pkgDirectory, {
  fields: ['someAdditonalField'],
  bin: ['someAdditionalScript.sh'],
});

License

MIT

Extension points exported contracts — how you extend this code

Options (Interface)
(no doc)
src/index.ts
Field (Interface)
(no doc)
src/fields.ts

Core symbols most depended-on inside this repo

pkgOk
called by 8
src/index.ts
normalize
called by 3
src/scripts.ts
isObject
called by 2
src/pkg.ts
doesNotExistError
called by 2
src/errors.ts
mustBeRelativeError
called by 2
src/errors.ts
doesNotExist
called by 2
src/fields.ts
mustBeRelative
called by 2
src/fields.ts
errorMessage
called by 1
src/bin.ts

Shape

Function 13
Interface 2

Languages

TypeScript100%

Modules by API surface

src/fields.ts6 symbols
src/scripts.ts3 symbols
src/index.ts2 symbols
src/errors.ts2 symbols
src/pkg.ts1 symbols
src/bin.ts1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add pkg-ok \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact