1.0.6 • Published 6 years ago
tsumami v1.0.6
tsumami
ES6 DOM Utility function
Installation
as NPM package
npm install tsumami --save
# or
yarn add tsumami
CDN delivered <script>
add the following script tags before your code
<script src="https://unpkg.com/tsumami"></script>
Tsumami modules will be available in the global scope as:
tsumami.dom
: DOM utilities docstsumami.EventManager
: EventManager constructor docstsumami.events
: global EventManager instance docstsumami.utils
: utilities docstsumami.Nodes
: Nodes constructor docs
Usage
Import individual functions and classes into your project
import { byId, qsa } from 'tsumami';
import events from 'tsumami/lib/events';
//like querySelectorAll but returns an array
const articles = qsa('.c-articles'); //Array.isArray(articles) === true
const form = byId('my-form');
events.on(form, 'submit', (e) => {
//...
});
Modules Docs
Contributing
- Fork it or clone the repo
- Install dependencies
yarn install
- Code your changes and write new tests in the
tests
folder. - Ensure everything is fine by running
yarn build
- Push it or submit a pull request :D