question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make this an npm module

See original GitHub issue

I’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:closed
  • Created 8 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rsmscommented, Sep 19, 2016

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

0reactions
rsmscommented, Sep 19, 2016
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found