npm.io
1.3.2 • Published 9 years ago

produce-package-keywords

Licence
MIT
Version
1.3.2
Deps
5
Vulns
0
Weekly
0

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

  • 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

Keywords