Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

Trim the `readme` fields on npm registry document objects.

License

Notifications You must be signed in to change notification settings

npm/npm-registry-readme-trim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm-registry-readme-trim

Trim the readme fields on npm registry document objects.

This will pull a single version's readme to the top-level of the document, and also reduce it in length to a max of 64kb.

Mutates the document in place, and returns true if it did anything.

USAGE

var trim = require('npm-registry-readme-trim')
var changed = trim(document)
if (changed) {
  // something was changed, probably have to PUT the doc back or whatever
} else {
  // everything was already in the right places, nothing to do
}

Or on the CLI, where it's JSON in, JSON out.

cat doc.json | npm-registry-readme-trim > trimmed.json

About

Trim the `readme` fields on npm registry document objects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published