NodeJS shebang (#!) line issue
See original GitHub issueHi,
I tried to use obfuscator on my project and got an issue with a shebang line
#!/usr/bin/env node
This is not a javascript comment line and i can’t disable obfuscator on it with a comment
// javascript-obfuscator:disable
because it needs to be at first line. How can i deal with ? I think i may delete it before obfuscator runs and inject it after processing my file.
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Node shebang line results in error since Node.js 12.16.0 #178
This commit checks the first line for shebang declarations and removes them before trying to load the module.
Read more >Node.js shebang - Alex Ewerlöf
Shebang or hashbang ( #! ) is the first line of the file which tells the OS which interpreter to use. It typically...
Read more >What exactly does "/usr/bin/env node" do at the beginning of ...
Specifically, you need a shebang line to create CLIs based on Node.js source files as part of an npm package, with the CLI(s)...
Read more >Universal Node.js shebang? - Unix & Linux Stack Exchange
The first line is, obviously, a Bourne shell shebang. Node.js bypasses any shebang that it finds, so this is a valid javascript file...
Read more >Build a Command Line Application with Node.js
Learn how to build command line applications using Node.js. ... The first line that begins with #! is usually called a “shebang.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, shebang doesn’t handled by
esprima
, you need to cutoff it before obfuscation. https://github.com/jquery/esprima/issues/1151Will be supported in the upcoming
0.26.0
. Will release it tomorrow.