bevry-archive / lazy-require

Sponsor this project to keep it maintained, or use Deno instead.
Other
17 stars 4 forks source link

Add version support #1

Open balupton opened 11 years ago

RobLoach commented 9 years ago

Used lazy-require for a thing: https://github.com/jstransformers/jstransformer-cli

Well done on this, Ben! :+1:

Glavin001 commented 8 years ago

+1 version support would be great!

@balupton I just read over your code. If you could write up how you would like the API to be, I could implement this and submit a Pull Request for you to review :smiley: . I was thinking that there be a version option or something similar.

balupton commented 8 years ago

@Glavin001 cool give me a moment, I'll move it from coffeescript to es6, then you can add your thing

have version as a properties of opts would be the way to go

Glavin001 commented 8 years ago

Also I noticed one of the tests failed, "incomplete". Is that just me?

balupton commented 8 years ago

@Glavin001 es6 version released, so good for your pull request, tests passing for me

We're also on slack at https://slack.bevry.me

ryanramage commented 8 years ago

I like the idea to have version support.

One potential issue to navigate would be if a package was requested with two different versions, how the node_modules folder would look.

Glavin001 commented 8 years ago

One potential issue to navigate would be if a package was requested with two different versions, how the node_modules folder would look.

It would only allow one. I suppose if the version of the most recent request was incompatible with the previously installed version then npm would trigger a fresh install of the currently requested version.

This is all backed by calling npm install <package> ( see https://github.com/bevry/lazy-require/blob/master/es6/lib/lazy-require.js#L238 ) so you could test the expected behaviour by running the commands in your Terminal.

zhaoyao91 commented 4 years ago

is there any update on this feature?