A shim that will run node in es5 (strict) mode for you. Implicit Globals: Never Again!
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md
index.js
package.json
test.js

README.md

use 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)

Install

sudo npm install -g node-es5

Usage

#!/usr/bin/env node-es5

Also, you can pull strict: true out of your .jshintrc and hopefully replace it with implicitstrict in the near future. See https://github.com/jshint/jshint/issues/924.

Hiccups

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.