Skip to content

fgnass/zepto-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This is a fork of Zepto.js that has been performance-optimized for server-side usage with jsdom or domino.

Rationale

The most straightforward approach to using Zepto.js with Node.js would be to wrap the whole library inside a huge closure and pass the current window object as parameter.

Unfortunately this leads to in pretty bad performance as a lot of processor time is spent with garbage collection.

In order to improve the performance characteristics the code as been refactored so that all prototype methods accesses the associated $ and windowobjects via this.$ and this.$.window.

Usage

var domino = require('domino');
var Zepto = require('zepto-node');

var window = domino.createWindow();

var $ = Zepto(window);
$('body').append('<h1>Hello World</h1>');

Tests

The original Evidence tests have been ported to Mocha and can be run via npm test.

Build Status

License

This code is based on Zepto.js, Copyright (c) 2010, 2011 Thomas Fuchs

Zepto.js is is licensed under the terms of the MIT License, see the included MIT-LICENSE file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages