A shim to always run node in es5 proper "strict mode"
npm install node-es5
|1||downloads in the last week|
|2||downloads in the last month|
|Version||1.0.0 last updated a year ago|
|Keywords||es5, strict mode, strict|
Node v0.10 marks a signficant milestone. NodeJS is now 100% es5 compliant. All of the core modules will run in es5 strict mode.
Unfortunately, however, you have to pass the
--use_strict argument to node
on the commandline in order to enforce compliance.
I created a shim so that you can shebang-run your apps (since you can't pass arguments to shebang'd commands)
npm install -g node-es5
There are still a lot of modules out there that are not es5 compliant, but most of the errors are simple typos with which the code still "worked" before.
Please help the community by forking and fixing as you run into trouble!
Why this shim?
To be abundantly clear, this won't work:
#!/usr/bin/env node --use_strict
ES5 has been around for a loooong time, so why now?
Octals. You can't use literal octals in es5 strict (it's an ambiguous syntax and hence removed), but a lot of the core node devs wanted to continue to use them.
Other than that... no idea.