zepto-modules

Zepto in CommonJS modules

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
zepto-modules
1.0.18 years ago8 years agoMinified + gzip package size for zepto-modules in KB

Readme

zepto-modules
Zepto (zepto@28.09.2016 - 1.2.0) in CommonJS modules

Installation

$ npm install --save zepto-modules

Usage

Configs (recommended):
// default config (zepto, event, ajax, form, ie)
var $ = require('zepto-modules');
// or
//var $ = require('zepto-modules/_default');

// --------------------------------

// custom config (zepto, event, form, ie, detect, data, touch, stack)
var $ = require('zepto-modules/_custom');

// --------------------------------

// min config (zepto, event, ie, stack)
var $ = require('zepto-modules/_min');

// --------------------------------

// write your own (./my-zepto)

var $ = require('zepto-modules/zepto');

require('zepto-modules/event');
require('zepto-modules/ajax');
require('zepto-modules/form');
require('zepto-modules/ie');

module.exports = $;

// later
var $ = require('./my-zepto');

When-you-need-it ™:
var $ = require('zepto-modules/zepto');
var each = require('cmnjs/each');

// these modules (singleton) extend zepto with methods which are available everywhere in your modules
require('zepto-modules/event');
require('zepto-modules/ie'); // kinda important

// rest of module

You can extend configs:
var $ = require('zepto-modules/_custom');

require('zepto-modules/ajax')

$.ajax({
  type: 'GET',
  url: '/projects',
  success: function(data) {
    // do sth
  }
});

ES6

import $ from 'zepto-modules';
// or
// import $ from 'zepto-modules/_default';

Changelog

View on github.