Make this an npm module
See original GitHub issueI’d like to use this module in node. For now I’d have to use a git submodule or copy/paste the code. Could this be made into an npm module?
All that would need to be done is use commonjs (or umd) to export the LRUCache
, run npm init
(make sure the package.json
main property is lru.js
), and then npm publish
.
A few recommended package names that aren’t taken would be:
least-recently-used
lru-algorithm
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Creating Node.js modules - npm Docs
To create a package.json file, on the command line, in the root directory of your Node.js module, run npm init : · Provide...
Read more >How to make a beautiful, tiny npm package and publish it
All tutorials about making an npm package, including the official documentation, tell you to enter certain fields in your package.json.
Read more >Best practices for creating a modern npm package - Snyk
Open your terminal and change directories to the folder of your cloned project. Example: cd modern-npm-package; Run npm init -y to create a ......
Read more >How to Create and Publish your own NPM Package
In this tutorial, we will create and publish to the NPM registry, an NPM package using the following steps. Create an NPM registry...
Read more >How To Create a Node.js Module - DigitalOcean
Step 1 — Creating a Module. This step will guide you through creating your first Node.js module. Your module will contain a collection...
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
FTR, this code has been or is still being used at Spotify, Facebook and Dropbox. It was created a long time ago with the intention to be portable, simple and just useful.
For these reasons I think it’s too small for being a NPM module — you really should just copy whatever parts of lru.js you need.
However, publishing an NPM package takes 30 seconds (which might explain the low quality of NPM, hint hint), so I’ve done just that.
Hope it helps
https://www.npmjs.com/package/lru-fast