I'm trying to use this in the webpub-viewer project to replace the in-tree copy.
I added r2-streamer-js as a devDependency and thought I could use it as a binary in one of my project's scripts.
It is not working unfortunately.
> webpub-viewer@0.1.0 streamed ./webpub-viewer
> r2-streamer-js-server ./examples/streamed/epubs/
./webpub-viewer/node_modules/.bin/r2-streamer-js-server: line 1: use strict: command not found
./webpub-viewer/node_modules/.bin/r2-streamer-js-server: line 2: syntax error near unexpected token `exports,'
./webpub-viewer/node_modules/.bin/r2-streamer-js-server: line 2: `Object.defineProperty(exports, "__esModule", { value: true });'
I believe you need to prepend the declared "bin" script with a node "shebang".
Example: https://github.com/isaacs/rimraf/blob/master/bin.js (Line 1)
After manually adding #!/usr/bin/env node to the dist bin script it works as expected.
I'm trying to use this in the webpub-viewer project to replace the in-tree copy.
I added
r2-streamer-jsas adevDependencyand thought I could use it as a binary in one of my project's scripts.It is not working unfortunately.
I believe you need to prepend the declared "bin" script with a node "shebang".
Example: https://github.com/isaacs/rimraf/blob/master/bin.js (Line 1)
After manually adding
#!/usr/bin/env nodeto the dist bin script it works as expected.