# @hungryinc/js-light-utils

> A small collection of js utils in a jquery-like $ syntax. But in only 8kb. It is Jbone (a lite jquery alternative) + AJAX + pubsub.

Latest version **1.1.0** (published 2017-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hungryinc/js-light-utils
pnpm add @hungryinc/js-light-utils
yarn add @hungryinc/js-light-utils
bun add @hungryinc/js-light-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-08-17 |
| First published | 2017-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Eric Chaves |
| Maintainers | hungryinc |

## Links

- npm: https://www.npmjs.com/package/@hungryinc/js-light-utils
- Repository: https://github.com/hungryinc/js-light-utils
- Homepage: https://github.com/hungryinc/js-light-utils#readme
- Issues: https://github.com/hungryinc/js-light-utils/issues
- npm.io page: https://npm.io/package/@hungryinc/js-light-utils

## Dependencies (2)

- [jbone](https://npm.io/package/jbone.md) ^1.2.0
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.0.5

## Recent versions

- 1.1.0 (latest) — 2017-08-17
- 1.0.8 — 2017-07-21
- 1.0.7 — 2017-07-21

## README

# JS Light Utils

JS Light Utils is a small collection of js utils wrapped up into a familiar jquery like $ object. But with a much smaller footprint.

- DOM: Powered by [jbone](https://www.npmjs.com/package/jbone) -- a tiny jquery replacment.
- AJAX: A [promise-based](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)  implementation with jquery syntax. Includes the es6-promise polyfill.
- Pubsub: A simple pubsub pattern for your modules.

### Usage with npm

Install with npm
```
npm install @hungryinc/js-light-utils
```
Use in your project
```
var $ = require('@hungryinc/js-light-utils');
```

### Dom Util
Use just like jQuery. Refer to [jbone docs](https://www.npmjs.com/package/jbone) for details.
```
$('a').addClass('rainbow-colors');
```

### Pubsub util
```
$.on(topic, listener)
$.off(topic)
$.trigger(topic, data)
```

### Ajax Util
```
// METHOD can be get, post, put, or delete
$.METHOD(url, [data])
```
Examples:
```
$.get('https://unicorns.magic').then(doTheThings);
```
```
$.post('https://unicorns.magic/launch', {which: 'garfolo'})
	.then(function (response) {
		console.log(response.data);
	}, function (response) {
		console.log(response.error);
	});
```

### Tests
- Here's an html playground with some quick and dirty tests for now.
`npm run build-tests`
- Then open tests/index.html

### FAQ
- How big is it?
-- 8kb gzipped (without the es6-promise polyfill. 16kb with the polyfill)

---
_Source: https://npm.io/package/@hungryinc/js-light-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
