produce-package-keywords
v1.3.2
Published
Produces keywords for your node.js package so that users can better find your package on npm
Downloads
2
Maintainers
Readme
produce-package-keywords
Produces keywords for a package by analyzing its package.json, a string, or file.
Table of Contents
Install
npm install produce-package-keywords --save
Usage
const ppk = require('produce-package-keywords')
produce keywords given a file
ppk.fromFile('path/to/file.txt', (error, result) => {
if (error) {
...
}
...
})
produce keywords given a string
ppk.process(string, callback)
// alias
ppk(string, callback)
ppk(string, (error, result) => {
if (error) {
...
}
...
})
or from package.json's name and description fields
ppk.process(callback)
// alias
ppk(callback)
ppk((error, result) => {
if (error) {
...
}
...
})
Api
producePackageKeywords([string], callback)
Returns an error first callback with an array of extracted keywords from string if given, otherwise from package.json's name and description fields.
options
[string] - optional string argument
callback - error first callback
producePackageKeywords.fromFile(file, callback)
Returns an error first callback with an array of extracted keywords from the given file
options
file - file to extract from
callback - error first callback
Tests
npm install
npm test
Contribute
PRs accepted and greatly appreciated.
Dependencies
- nlcst-to-string: Stringify NLCST
- read-pkg-up: Read the closest package.json file
- retext: Natural language processor powered by plugins
- retext-keywords: Keyword extraction with Retext
Dev Dependencies
- babel-cli: Babel command line.
- babel-preset-latest: Babel preset including es2015+
- codecov: Uploading report to Codecov: https://codecov.io
- nyc: the Istanbul command line interface
- rimraf: A deep deletion module for node (like
rm -rf
) - tap-spec: Formatted TAP output like Mocha's spec reporter
- tape: tap-producing test harness for node and browsers
License
MIT © mrzmmr