https://github.com/lucaperret/gaspard
Lightweight DOM helpers without dependency
https://github.com/lucaperret/gaspard
dom-manipulation esnext javascript jquery-like library youmightnotneed
Last synced: 2 months ago
JSON representation
Lightweight DOM helpers without dependency
- Host: GitHub
- URL: https://github.com/lucaperret/gaspard
- Owner: lucaperret
- License: mit
- Created: 2017-07-25T16:15:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-31T01:17:14.000Z (almost 5 years ago)
- Last Synced: 2025-02-17T19:16:16.824Z (3 months ago)
- Topics: dom-manipulation, esnext, javascript, jquery-like, library, youmightnotneed
- Language: JavaScript
- Homepage: https://lucaperret.github.io/gaspard
- Size: 4.52 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://github.com/lucaperret/gaspard)
# Gaspard[](https://greenkeeper.io/)
> Lightweight DOM helpers without dependency[](https://www.npmjs.com/package/gaspard)
[](https://travis-ci.org/lucaperret/gaspard)
[](https://coveralls.io/github/lucaperret/gaspard?branch=master)[](https://badge.fury.io/js/gaspard)
[](https://david-dm.org/lucaperret/gaspard.svg#info=devDependencies)
[](http://commitizen.github.io/cz-cli/)The goal is to implement each [You might not need jQuery](http://youmightnotneedjquery.com)'s functions as ES modules. Enabling the power of Tree-shaking in [webpack](https://webpack.js.org/guides/tree-shaking/) or [rollup](https://rollupjs.org/#tree-shaking).
## Getting started
### Installing
npm | yarn | bower | jsDelivr
------------ | ------------- | ------------- | -------------
npm install gaspard | yarn add gaspard | bower install gaspard | [gaspard.umd.js](https://cdn.jsdelivr.net/npm/gaspard@latest/dist/gaspard.umd.js)**The Vue.js plugin [Vue-gaspard](https://github.com/lucaperret/vue-gaspard) is also available!**
### Usage
Include gaspard on your project
```javascript
// Via ES2015 import statement
import * as Gaspard from 'gaspard'// or via Commonjs
const Gaspard = require('gaspard')
```And import methods (listed in the [API Documentation](#API))
```javascript
import { documentReady, find, css, addClass, fadeIn } from 'gaspard'documentReady(() => {
addClass(document.documentElement, 'dom-loaded')const app = find('#app')
css(app, 'background-color', 'green')const paragraph = find('p:first-child', app)[0]
addClass(paragraph, 'introduction')
fadeIn(paragraph)
})
```Or use gaspard within a ``
```html
<script src="https://cdn.jsdelivr.net/npm/gaspard@latest/dist/gaspard.umd.js">Gaspard.documentReady(function () {
Gaspard.addClass(document.documentElement, 'dom-loaded');
});```
### API documentation
- [](https://doxdox.org/lucaperret/gaspard)
- [Markdown](https://github.com/lucaperret/gaspard/blob/master/docs/API.md)
## Contribute
- Fork the repository
- Clone it locally and install dependencies with npm (or yarn)
```shell
npm install
```
- Create a new branch
- Develop your feature/fix with tests running
```shell
npm run test:watch
```
- Commit, Push your branch and make a pull request on gaspard repository## Thanks
Thanks to the open source community of [You might not need jQuery](http://youmightnotneedjquery.com), jQuery, and [cash](https://github.com/kenwheeler/cash/)
## Licensing
MIT License Copyright (c) 2017 Luca Perret