> ## Documentation Index
> Fetch the complete documentation index at: https://docs.commonality.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Package Manager

Use these checks to make it easier to work with scripts, dependencies, and more.

### Check that a package has specific scripts

Helpful when using a task runner or package manager that allows running scripts across many packages.

```ts .commonality/has-build-scripts.ts theme={null}
import { hasJsonFile } from 'commonality-checks-recommended';

export default hasJsonFile('package.json', {
  scripts: {
    build: 'tsc --build',
    dev: 'tsc --watch',
  },
});
```

```json .commonality/config.json theme={null}
{
  "checks": [
    "buildable": [
      "has-build-scripts"
    ]
  ]
}
```

### Check that a package has an `.npmignore`

Useful to prevent publishing `dist` directories or `*.test.*` files.

```ts .commonality/has-npm-ignore.ts theme={null}
import { hasText } from 'commonality-checks-recommended';

export default hasText('.npmignore', ['dist']);
```

```json .commonality/config.json theme={null}
{
  "checks": [
    "publishable": [
      "has-npm-ignore"
    ]
  ]
}
```
