Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
YUI3 Bootstrapper for Node.js
tag: 0.5.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
scripts
tests
.gitignore
LICENSE
Makefile
README.textile
package.json

README.textile

YUI Bootstrapper for Node.js

This node.js module attempts to setup and bootstrap a working YUI 3 instance.

This module includes support for remote script loading via Y.Get.script() and remote data fetching via Y.io.

See “JSDom Support” below for DOM manipulation.

Node.js

All of the examples and tests assume you have node in your path and they are all executable.

Installing – via NPM

npm install yui3

Installing – as a developer

git clone git://github.com/davglass/nodejs-yui3.git
make dev
make install

Using YUI3

This is the general-dom example

Using the Y.Browser object

To comply with the “no-globals” CommonJS spec, there is no global document or window in this mode.
Just including the nodejs-dom module will create a fake dom for this instance.
You can create a document like this:
View this Gist

You can make older DOM code run by setting up a couple of local variables, like this

If you are using YUI to serve pages, you should use a Nested Use to create the document when the request comes in.

Something like this

I have an example showing this: examples/y-browser.js

Examples

    cd examples/
    ./general-dom.js
    ./io.js
    ./library.js
    ./y-brower.js

Tests

When using JSDom, All relevent YUI 3 Dom & Selector tests pass. The ones that are skipped revolve around styles and postioning. Since there is no window or CSS cascade, these seem unimportant at the moment.

    cd ./tests/
    ./dom.js
    ./selector.js
Something went wrong with that request. Please try again.