Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to load and run archived package #31699

Closed
skyshore2001 opened this issue Feb 8, 2020 · 1 comment
Closed

Support to load and run archived package #31699

skyshore2001 opened this issue Feb 8, 2020 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@skyshore2001
Copy link

skyshore2001 commented Feb 8, 2020

node is expected to support the archive package like jar for java package.
We suppose the nar file means node archive package.
e.g. the core-js package contains >1700 files and 7MB, it can be installed as one file like core-js.3.0.1.nar with <500KB space.

node should load files in the archive package without extracting any files, instead of loading hundreds of files from disk. It will benefit the performance greatly.

  • jar (java archive package) have been mature for many years. We can refer to the jar/java document and spec here: https://docs.oracle.com/javase/8/docs/technotes/guides/jar/index.html
  • Well-designed archive will improve performance greatly, not only the disk space. Files are all loaded from the archive directly (possibly with index). Any achive solution that requires extracting files is not what we want.

Run a package: (e.g. run index.js inside the nar file)
node -nar myapp.nar

require('xxx') can load module from either the xxx/ folder or the xxx.nar file.

link to npm issue: npm/rfcs#100

PS. I find a nar module https://www.npmjs.com/package/nar/v/0.1.0-rc.2
but it is not what I expect, as it extracts files from the package before running.

@devsnek
Copy link
Member

devsnek commented Feb 8, 2020

Duplicate of #1278

@devsnek devsnek marked this as a duplicate of #1278 Feb 8, 2020
@devsnek devsnek closed this as completed Feb 8, 2020
@devsnek devsnek added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

2 participants