gatsby-source-package-licenses
v1.0.2
Published
Source plugin for pulling license data from NPM packages.
Downloads
18
Maintainers
Readme
Gatsby Source Package License
Gatsby Plug-in to source all the licenses from the dependencies of a project.
How to use
Add to gatsby-config.js
:
...
plugins: [
...
{
resolve: `gatsby-source-package-licenses`,
options: {
cacheFile: "yarn.lock",
},
},
]
...
Sourcing is pretty fast but still you can use cacheFile
to speed up the process. Use yarn.lock
or package-lock.json
depending on your package manager.
Query:
{
allPackageLicense {
edges {
node {
identifier
license
licenseText
package
url
version
}
}
}
}
Example result:
{
"node": {
"identifier": "@gatsbyjs/[email protected]",
"license": "MIT",
"licenseText": "Copyright JS Foundation and other contributors\n\nPermissionhereby granted...",
"package": "@gatsbyjs/webpack-hot-middleware",
"url": "https://github.com/gatsbyjs/webpack-hot-middleware",
"version": "2.25.2"
}
}
Development
Linking the plugins folder to the sample site
cd plugin
yarn link
cd ../sample-site
yarn link "gatsby-source-package-licenses"
To publish a new version to NPM
- Bump version in package.json
- Update readme (both i guess)
cp README.md ./plugin
cd plugins && npm publish