{"id":13465158,"url":"https://github.com/abraham/pkg-ok","last_synced_at":"2025-05-15T15:08:10.667Z","repository":{"id":39104927,"uuid":"82593962","full_name":"abraham/pkg-ok","owner":"abraham","description":"👌 Checks paths and scripts defined in package.json before you publish","archived":false,"fork":false,"pushed_at":"2025-05-01T17:44:12.000Z","size":268,"stargazers_count":236,"open_issues_count":10,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T03:08:33.455Z","etag":null,"topics":["bin","cli","crlf","hacktoberfest","lf","line-endings","main","package","path","publish","test"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pkg-ok","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abraham.png","metadata":{"funding":{"github":"abraham"},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-20T19:25:41.000Z","updated_at":"2025-03-03T22:19:51.000Z","dependencies_parsed_at":"2023-02-17T08:30:50.462Z","dependency_job_id":"bedabdbf-c765-41e5-9b30-eacfa0ff57ee","html_url":"https://github.com/abraham/pkg-ok","commit_stats":{"total_commits":123,"total_committers":5,"mean_commits":24.6,"dds":0.5691056910569106,"last_synced_commit":"1af1fef4e0b2f848e556ff4c5fc43a35b671bcf1"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fpkg-ok","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fpkg-ok/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fpkg-ok/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fpkg-ok/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abraham","download_url":"https://codeload.github.com/abraham/pkg-ok/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254364270,"owners_count":22058878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bin","cli","crlf","hacktoberfest","lf","line-endings","main","package","path","publish","test"],"created_at":"2024-07-31T14:01:01.889Z","updated_at":"2025-05-15T15:08:05.657Z","avatar_url":"https://github.com/abraham.png","language":"TypeScript","readme":"# pkg-ok [![Build status](https://github.com/abraham/pkg-ok/actions/workflows/index.yaml/badge.svg)](https://github.com/abraham/pkg-ok/actions/workflows/index.yaml) [![npm](https://img.shields.io/npm/v/pkg-ok.svg)](https://www.npmjs.com/package/pkg-ok)\n\n\u003e `pkg-ok` checks paths and scripts defined in `package.json` before you publish 👌\n\n- Ensures paths defined in `main`, `bin`, `module`, `types`, `typings`, `es2015`, `browser`, and `exports` exist\n- Ensures paths defined in `main`, `bin`, and `browser` are relative\n- Ensures `bin` scripts use cross-platform line endings\n\n## Usage\n\n```sh\nnpm install pkg-ok --save-dev\n```\n\n```js\n// package.json\n{\n  \"main\": \"oops_this_file_doesnt_exist.js\",\n  \"scripts\": {\n    \"prepublishOnly\": \"... \u0026\u0026 pkg-ok\"\n  }\n}\n```\n\n```sh\nnpm publish\n# Error!\n# Since main file doesn't exist, publish is blocked\n```\n\n## CLI\n\nCheck the `package.json` in the current directory.\n\n```sh\npkg-ok\n```\n\nCheck the `package.json` in a specific directory.\n\n```sh\npkg-ok some/directory\n```\n\nCheck additional `package.json` fields or bin files.\n\n```sh\npkg-ok --field someField --bin script.sh\n```\n\n## API\n\n```js\nconst pkgDirectory = __dirname;\n\npkgOk(pkgDirectory, {\n  fields: ['someAdditonalField'],\n  bin: ['someAdditionalScript.sh'],\n});\n```\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/abraham"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabraham%2Fpkg-ok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabraham%2Fpkg-ok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabraham%2Fpkg-ok/lists"}