Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Connect-strictenjs is a connect middleware that add ES5 strict mode to the script you served, together with code beautifier (from Uglify-js2).
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
README.md
package.json

README.md

connect-strictenjs

overview

This is a connect middelware that adds ECMAScript 5 (ES5) strict mode by prepending "use strict" to all javascript blocks. As developers do not need to modify the html or JS code that the server is serving, one could quickly test if their code are compatible with the ES5 strict mode.

The package also comes with a code beautifier (based on UglifyJS2), which allows easier troubleshooting when syntax errors are reported on minified code.

installation

from npm - TBD

from git

git clone git://github.com/yukinying/connect-strictenjs.git
cd connect-strictenjs 
npm link .

recommended usage

Use it with the javascript testing framework that use connect. To enable the middleware, one should simply patch the code with

var strict = require('connect-strictenjs');

app = express();

app.use(strict.stricten() );
app.use(strict.beautifier());

// ... other logics that render the pages

Sample code could be found in the examples directory.

Something went wrong with that request. Please try again.