Fixpack

fixpack

A package.json file scrubber for the truly insane.

GET IT: npm install -g fixpack

It will re-write your package.json file as follows:

  • name first
  • description second
  • version third
  • author fourth
  • all other keys in alphabetical order
  • dependencies and devDependencies sorted alphabetically
  • newline at the end of the file

It will warn you if any of these are missing:

  • description
  • author
  • repository
  • keywords
  • main
  • bugs
  • homepage
  • license

It can also read a config from .fixpackrc:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
    // will put these first in this order if present
    sortToTop: [
        'name',
        'description',
        'version',
        'author'
    ],
    // will error if these not present
    required: [
        'name',
        'version'
    ],
    // will warn if these not present
    warn: [
        'description',
        'author',
        'repository',
        'keywords',
        'main',
        'bugs',
        'homepage',
        'license'
    ],
    // if `private: true` in package.json will use the next two lists instead
    requiredOnPrivate: [],
    warnOnPrivate: ['name', 'version', 'description', 'main'],
    // sub items to sort by default
    sortedSubItems: [
        'dependencies',
        'devDependencies',
        'jshintConfig',
        'scripts',
        'keywords'
    ],
    // if you set quiet to true it won't do output anything to the console
    quiet: false,
    // files to scrub
    files: ['package.json'],
    // Will set all deps to '*'
    // this may be useful because then you can
    // run npm update --save && npm update --save-dev
    // to install latest stable releases of everything.
    wipe: false
}

GIF FTW!

fixpack

Suggest a module

Comments