3rd-Eden / node-hashring

hashring is a consistent hashing algorithm for Node.js that is compatible with libketama and python's hash_ring package
MIT License
350 stars 61 forks source link

Explicitly select files to ship to npm #38

Closed jkrems closed 4 years ago

jkrems commented 8 years ago

The tests directory is pretty big. This changes selects which files to publish explicitly. npm will automatically include README, LICENSE, and CHANGELOG files.

Before:

> npm i hashring@latest && du -sh node_modules/hashring && ls node_modules/hashring
hashring@3.2.0 node_modules/hashring
├── connection-parse@0.0.7
└── simple-lru-cache@0.0.2
4.7M    node_modules/hashring
CHANGELOG     LICENSE       Makefile      README.md     benchmarks/   doc/          index.js      node_modules/ package.json  tests/

After:

> npm i ~/Projects/node/libs/node-hashring && du -sh node_modules/hashring && ls node_modules/hashring
hashring@3.2.0 node_modules/hashring
├── connection-parse@0.0.7
└── simple-lru-cache@0.0.2
132K    node_modules/hashring
CHANGELOG     LICENSE       README.md     index.js      node_modules/ package.json
3rd-Eden commented 8 years ago

Is "files" a new thing of npm? I thought that ignoring files was always done using an .npmignore file.

jkrems commented 8 years ago

Yep, it's potentially a two-step process: Everything in files but what is ignored via .npmignore. I personally prefer using files most of the time because it's harder to accidentally publish files. But happy to update this PR to use .npmignore.

See: https://docs.npmjs.com/files/package.json#files

P.S.: Sorry, misread your "new". Not sure how new it is. I'm actually not sure when it was added. But it's definitely working with npm 2.

itspolo commented 7 years ago

👍 Any chance of merging this PR :)