Nanashi.
Nanashi.2y ago

How to import npm module from github?

-
14 Replies
Nanashi.
Nanashi.2y ago
I want to use a npm module which is not on npm (https://github.com/ZJONSSON/node-unzipper/blob/341f258 ) I tried
// @deno-types="npm:@types/unzipper@0.10"
export { Extract } from "https://github.com/ZJONSSON/node-unzipper/raw/341f258/lib/extract.js";
// @deno-types="npm:@types/unzipper@0.10"
export { Extract } from "https://github.com/ZJONSSON/node-unzipper/raw/341f258/lib/extract.js";
, but it did not work:
error: Uncaught SyntaxError: The requested module 'https://github.com/ZJONSSON/node-unzipper/raw/341f258/lib/extract.js' does not provide an export named 'Extract'
export { Extract } from "https://github.com/ZJONSSON/node-unzipper/raw/341f258/lib/extract.js";
^
at <anonymous> (file:///E:/voicevox-project/vvproxy/deps.ts:3:10)
error: Uncaught SyntaxError: The requested module 'https://github.com/ZJONSSON/node-unzipper/raw/341f258/lib/extract.js' does not provide an export named 'Extract'
export { Extract } from "https://github.com/ZJONSSON/node-unzipper/raw/341f258/lib/extract.js";
^
at <anonymous> (file:///E:/voicevox-project/vvproxy/deps.ts:3:10)
I guess that I need to make deno recognize it's a npm module, but i don't know how to.
ioB
ioB2y ago
npm
unzipper
Unzip cross-platform streaming API . Latest version: 0.10.11, last published: 3 years ago. Start using unzipper in your project by running npm i unzipper. There are 1073 other projects in the npm registry using unzipper.
Nanashi.
Nanashi.2y ago
yes, but I want to use unreleased version
Nanashi.
Nanashi.2y ago
GitHub
publish latest version? · Issue #256 · ZJONSSON/node-unzipper
package.json is on 0.10.13 but the last publish to NPM was 2yrs ago (0.10.11) - can you publish the latest to NPM?
ioB
ioB2y ago
Hm. Not sure if this is possible with the current setup, definitely interesting. What is your usecase? Would https://deno.land/x/zip not work for what you're trying to do?
Nanashi.
Nanashi.2y ago
It didn't.
ioB
ioB2y ago
What are you trying to do?
Nanashi.
Nanashi.2y ago
Unzipping this package didn't work
ioB
ioB2y ago
.zip is not just one standard. Where are these zips coming from? A lot of "streamable unzip" libraries cannot work the way they are advertised because some zip formats are not streamably unzippable. Is there a reason you need the unreleased version? Does importing the one on npm work right now?
Nanashi.
Nanashi.2y ago
Yes, npm latest doesn't support zip64, but unreleased one does
ioB
ioB2y ago
Have you tried https://deno.land/x/zipjs ?
Nanashi.
Nanashi.2y ago
I didn't know this, i'll try it
Nanashi.
Nanashi.2y ago
(sigh)
Nanashi.
Nanashi.2y ago
thanks, it worked well,
How to import npm module from github?
The answer is "impossible"?