Next: , Up: Including [Contents]


1.3.1 Server-Side Include

ease.js should work with any CommonJS-compliant system. The examples below have been tested with Node.js. Support is not guaranteed with any other software.

Let’s assume that you have installed ease.js somewhere that is accessible to require.paths. If you used a tool such as npm, this should have been done for you.

/** example-include.js **/
var easejs = require( 'easejs' );

Figure 1.1: Including ease.js via require()

It’s important to understand what exactly the above command is doing. We are including the easejs/ directory (adjust your path as needed). Inside that directory is the index.js file, which is loaded. The exports of that module are returned and assigned to the easejs variable. We will discuss what to actually do with those exports later on.

That’s it. You should now have ease.js available to your project.

Part of the GNU Project

Copyright © 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation, Inc.

"GNU Inside!" Page Fold licensed under CC-BY-SA 2.0; incorporates "A Big GNU Head".

The source code of this website is available in the website branch of the Git repository.

Authored by Mike Gerwitz

AltStyle によって変換されたページ (->オリジナル) /