# gatsby-source-package

> Gatsby source plugin to source contents of npm package.json

Latest version **1.1.1** (published 2023-12-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatsby-source-package
pnpm add gatsby-source-package
yarn add gatsby-source-package
bun add gatsby-source-package
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2023-12-13 |
| First published | 2021-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Marijan Barkic |
| Maintainers | kolossal-io |
| Keywords | gatsby, gatsby-plugin, npm |

## Links

- npm: https://www.npmjs.com/package/gatsby-source-package
- Repository: https://github.com/kolossal-io/gatsby-source-package
- Homepage: https://github.com/kolossal-io/gatsby-source-package#readme
- Issues: https://github.com/kolossal-io/gatsby-source-package/issues
- npm.io page: https://npm.io/package/gatsby-source-package

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0

## Recent versions

- 1.1.1 (latest) — 2023-12-13
- 1.0.1 — 2022-02-07
- 1.0.0 — 2021-10-27

## README

# gatsby-source-package

This plugin allows you to source the contents of `package.json`.

## Install

```bash
npm install --save gatsby-source-package
```

or

```bash
yarn add gatsby-source-package
```

## How to use

Add the plugin to `gatsby-config.js`..

```js
module.exports = {
  plugins: [...`gatsby-source-package`],
};
```

You may only source some of the keys in `package.json`:

```js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-package`,
      options: {
        only: ['name', 'version', 'description'],
      },
    },
  ],
};
```

## Query package.json

The GraphQL query will match your `package.json`:

```graphql
query {
  package {
    name
    version
    description
  }
}
```

Result:

```json
{
  "data": {
    "package": {
      "name": "gatsby-starter-hello-world",
      "version": "0.1.0",
      "description": "A simplified bare-bones starter for Gatsby"
    }
  },
  "extensions": {}
}
```

---
_Source: https://npm.io/package/gatsby-source-package · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
