Skip to content
forked from bendc/sprint

A tiny, lightning fast jQuery-like library for modern browsers.

License

Notifications You must be signed in to change notification settings

kurtextrem/sprint

This branch is 36 commits ahead of bendc/sprint:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cc2fa56 · Oct 11, 2018
Jul 15, 2015
Jun 8, 2015
Jun 9, 2015
Jan 12, 2015
Oct 13, 2016
Apr 24, 2015
Oct 11, 2018
Oct 11, 2018
Oct 11, 2018
Oct 11, 2018

Repository files navigation

Sprint.js Build Status

Join the chat at https://gitter.im/philplckthun/sprint

This is a fork of Benjamin De Cock's original repository. Our goal is to push the development of Sprint further and merge back sometime in the future.

Sprint is a high-performance, 5KB (gzipped) DOM library for modern browsers. Sprint notably shines on bandwidth and resource constrained devices such as phones and tablets.

Sprint has a familiar, jQuery-like chainable API:

$("div").addClass("new").append("<p>Hi Sprint</p>");

Installation

Download the minified version and include it in your page.

<script src="sprint.min.js"></script>

Alternatively you can install Sprint via npm and import it, for example to use it with your existing build system.

npm install sprint-js

There's Bower support as well:

bower install sprint

Philosophy

Sprint is an alternative—not a replacement—for jQuery. jQuery offers more features, handles more edge cases and supports more browsers. Sprint is just a thin layer making the DOM friendlier without sacrificing on performance.

Performance

Sprint relies on newer APIs supported by modern browsers (read: IE10+) and optimizes a bunch of other things in order to provide you with fast DOM operations.

Here are a few performance tests of some popular methods (Chrome 42, OS X 10.10.3) :

.add()

jsperf results

→ View on jsperf

.attr()

jsperf results

→ View on jsperf

.css()

jsperf results

→ View on jsperf

.has()

jsperf results

→ View on jsperf

.map()

jsperf results

→ View on jsperf

.next()

jsperf results

→ View on jsperf

.not()

jsperf results

→ View on jsperf

.parents()

jsperf results

→ View on jsperf

.position()

jsperf results

→ View on jsperf

.slice()

jsperf results

→ View on jsperf

.text()

jsperf results

→ View on jsperf

Thanks to its reduced feature set, Sprint is also a lot faster to parse and execute (about 40 times faster than jQuery).

API

The methods supported by Sprint are, for the most part, identical to jQuery's. The few small differences with jQuery are explained below. If nothing is mentioned, you can assume jQuery's documentation applies.

About

A tiny, lightning fast jQuery-like library for modern browsers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%