Giter Site home page Giter Site logo

snack's Introduction

snack.js

... because sometimes, all you need is a snack.

Features

Tiny!

  • ~3.4kb! (minified, gzipped)

Elements

  • Use any selector engine. Ships with multiple builds (QSA, Qwery, Slick, Sizzle)
  • Several element methods
  • API to add more element methods

Events

  • Cross-browser DOMContentLoaded (domready)
  • Cross-browser DOM events
  • Event Delegation (with or without a selector engine)

Pub/Sub

  • Publisher objects for application communication

AJAX

  • Cross-browser AJAX
  • JSONP

Utilities

  • Shallow object merge with snack.extend
  • Prototypal inheritance with Object.create
  • A few other utilities (only those snack uses)

Documentation

Snack is very well documented. In the repository is a docs folder. Simply open docs/index.html in your browser or visit the Snack Homepage.

Contributing / Testing / Building Snack

Submodules (selector engines)

Because Snack ships with several selector engines, there are submodules for each one. You'll need to first update them to build or test Snack:

From the root of the repository:

$ git submodule init
$ git submodule update

Tests

The tests require node >= 0.4.6, npm >= 1.0.0, and submodules to be updated (see above).

To run the tests, install dependencies and fire up the server (used for all the ajax stuff).

$ npm install .
$ node server.js

Building

Build snack like so:

$ ./build

The tests do not require you to build snack.

Inspiration and code snatching from:

  • MooTools (c) Valerio Proietti, MIT license
  • jQuery (c) John Resig, Dual license MIT or GPL Version 2
  • Zepto (c) Thomas Fuchs, MIT License
  • ContentLoaded (c) Diego Perini, MIT License

License

MIT Style license.

Copyright

Copyright (c) Ryan Florence

snack's People

Contributors

ryanflorence avatar subtlegradient avatar alpha123 avatar jiggliemon avatar eddmann avatar

Watchers

Alvar Laigna avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.