produce-package-keywords

1.3.2 • Public • Published

produce-package-keywords

CircleCI Codecov npm

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

standard-readme compliant David David

Contribute

PRs accepted and greatly appreciated.

Dependencies

Dev Dependencies

License

MIT © mrzmmr

/produce-package-keywords/

    Package Sidebar

    Install

    npm i produce-package-keywords

    Weekly Downloads

    0

    Version

    1.3.2

    License

    MIT

    Last publish

    Collaborators

    • mrzmmr