NPM package is bundled with useless files and is too big (3 Mo that can be reduced to 620 Ko)
See original GitHub issueFirst of all: NeDB is awesome!
Big NPM package with unnecessary files
The NPM package is quite big and includes many unnecessary files (and dependencies) for a Node.js usage.
Uncompressed NPM package size is about 3 Mo and can be reduced to 620 Ko !
Here is the total size with dependencies:
88K async
132K binary-search-tree
1.1M localforage (UNNECESSARY)
92K mkdirp
1.4M nedb
184K underscore
And the detailed size of naked NeDB package
4.0K LICENSE
44K README.md
44K benchmarks (USELESS)
4.0K bower.json (USELESS)
916K browser-version (USELESS)
4.0K index.js
96K lib
4.0K package.json
292K test (USELESS)
20K test_lac (USELESS)
Potential Solutions
I’m focused on the NPM deployment so I may miss some browser deployment considerations… Let me know if it make sense…
.npmignore ?
I think NeDB can easily save 1.30 Mo by adding the following .npmignore file to the repo:
benchmarks
bower.json
browser-version
test
test_lac
PS: This has already been done in the bower.json file.
Move localforage to devDependencies ?
Now about the localforage dependency… it looks like it is already bundled into browser-version/out… Can we simply move localforage dependencies to devDependencies in package.json?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Node module size: See how I reduced it by 90% | TSH.io
Most of our projects have seen +-33% reduction of node_modules size after we've used it (176MB). Remove unnecessary files. Have you ever thought ......
Read more >5 Methods to Reduce JavaScript Bundle Size - Bits and Pieces
In this article, I will discuss 5 techniques to reduce the JavaScript bundle size to avoid any performance bottlenecks. 1. Code Splitting with ......
Read more >Guidelines for Environmental Infection Control in Health-Care ...
The full-text version of the guidelines appears as a web-based document at the CDC's Division of. Healthcare Quality Promotion's Infection Control website. ( ......
Read more >The Structural Mechanics Module User's Guide
3 . The difference in stiffness along different directions can thus become very large. When an object is very thin, a shell model...
Read more >WindPRO 2.7 User Guide - EMD International
Chapter 7, module WINDPLAN is no longer included due to low ... the WindPRO software in C:\Program files\EMD\WindPRO2.7\ by default.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the kind words 😃
So there are also standalone versions of NeDB for the browser which clock in at 292KB and 98 KB when minified: https://github.com/louischatriot/nedb/blob/master/browser-version/out/nedb.js and https://github.com/louischatriot/nedb/blob/master/browser-version/out/nedb.min.js
That said you are right about the server version, the npm package itself could be cleaned to only include the necessary files. Will try to do it when I have the time!
You can whitelist the files quickly in package.json and check the published size, see https://glebbahmutov.com/blog/smaller-published-NPM-modules/ for example to measure NPM published size you can add script command
This will print the list of files included in published tar as well as total size