Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
argyleink committed Apr 5, 2018
2 parents 0a58013 + 275c909 commit a80a836
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ If you agree with any of the following, you may appreciate this tiny library:
* Loved jQuery selector syntax

###### Why BlingBling?
- Minimal
- Minimal at 572 bytes gzipped
- Worth it's weight (should save more characters than it loads)
- Only enhances the nodes you query with it
- ES6 version of popular [bling.js](https://gist.github.com/paulirish/12fb951a8b893a454b32) by Paul Irish
- Tested
- [Tested](https://github.com/argyleink/blingblingjs/blob/master/src/index.test.js)

<!-- [START getstarted] -->
## Getting Started
Expand All @@ -42,7 +42,9 @@ BlingBling supports ES6 module importing and common module loading

**Examples**
```js
import { $, $$ } from 'blingblingjs'
// import the bling or the blingbling
import { $, $$ } from 'blingblingjs' // es6 module support
const { $, $$ } = require('blingblingjs') // commonjs support

// query the DOM easier
const main_btn = $('button[primary]')
Expand All @@ -54,8 +56,10 @@ main_btn.on('click', e => console.log(e.target))
btns.on('click', e => console.info(e.target))

// convert nodes to have the bling sugar
$(document.querySelector('button'))
$$(document.querySelectorAll('button'))
let single = document.querySelector('button')
let singles = document.querySelectorAll('button')
let sugared_single = $(single)
let sugared_singles = $$(singles)

// use native array methods on the nodes: map, reduce, filter
btns.forEach(btn => console.warn(btn))
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@
"name": "blingblingjs",
"version": "1.0.1",
"description": "like bling.js, but more bling",
"repository": {
"type": "git",
"url": "https://github.com/argyleink/blingblingjs.git"
},
"main": "dist/index.js",
"module": "src/index.js",
"scripts": {
"test": "npm run build && ava -v",
"build": "rollup src/index.js --format umd --name 'blingblingjs' --file dist/index.js"
},
"author": "argyleink",
"keywords": [
"javascript",
"utility",
"jquery-like",
"es6"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/argyleink/blingblingjs/issues"
},
"devDependencies": {
"ava": "^1.0.0-beta.3",
"browser-env": "^3.2.5",
Expand Down

0 comments on commit a80a836

Please sign in to comment.