<commit_before># Tiny

> A JavaScript utility library oriented to real world tasks.

## Purpose

Tiny aims to stay small and simple, while powerful and really useful.

Inspired by jQuery and Underscore, but using concepts from [You might not need jQuery](http://youmightnotneedjquery.com/) and the power of ES6 (ES2015).

Methods are implemented individually and not as part of a whole.

## Installation

There are multiple ways to use Tiny.

### Inline resource (recommended)

Grab [the distributable code](https://github.com/mercadolibre/tiny.js/blob/master/dist/tiny.min.js) and embed into a `<script>` tag just before the `</body>` tag.

### Module

Use NPM or Bower and include Tiny as part of the build process.

```shell
npm install mercadolibre/tiny.js
```

```shell
bower install tiny
```

### From CDN

```html
<script src="//ui.mlstatic.com/chico/tiny/x.x.x/tiny.min.js"></script>
```

Check [releases](https://github.com/mercadolibre/tiny.js/releases) to find the latest version number.


## API

### `tiny.clone(obj)`

Creates a copy of the provided object.

- `obj`: type `Object`. The object to be cloned.

Returns an `Object`.

### `tiny.extend([deep,] target, ...sources)`

**[WIP]**

### `tiny.inherits(obj, superConstructor)`

Inherits the prototype methods from one constructor into another.

The parent will be accessible through the `obj.super_` property.

Fully compatible with standard Node.js `inherits`.

- `obj`: type `Object`. An object that will have the new members.
- `superConstructor`: type `Function`. The constructor Class.

### `tiny.isPlainObject(obj)`

Validates for a valid Object.

- `obj`: type `Object`. The object to be validated.

Returns a `Boolean`.

### `tiny.EventEmitter`

Node's event emitter.

The most relevant methods:

- `on()`
- `once()`
- `emmit()`

**[WIP]**

**See the [external module](https://www.npmjs.com/package/events) and the [docs](https://nodejs.org/api/events.html#events_class_events_eventemitter) for a complete reference.**

### `tiny.DOMEvents`

**[WIP]**

- `on()`:
- `off()`:
- `once()`:
- `trigger()`:

### `tiny.classList(el)`

Manages the CSS class names of a defined DOM element.

- `el`: A given `HTMLElement`.

Returns methods to manage class names:

- `add(className)`: Receives a `String` with the given CSS class name.
- `remove(className)`: Same.
- `contains(className)`: Same. Returns a `Boolean`.

Example:
```js
tiny.classList(document.body).contains('example'); // => false

tiny.classList(document.body).add('example');

tiny.classList(document.body).contains('example'); // => true
```

### `tiny.css(el, key[, value])`

Get the value of a computed style for the first element in set of<commit_msg>Change readme.md to reflect the latest classList changes<commit_after># Tiny

> A JavaScript utility library oriented to real world tasks.

## Purpose

Tiny aims to stay small and simple, while powerful and really useful.

Inspired by jQuery and Underscore, but using concepts from [You might not need jQuery](http://youmightnotneedjquery.com/) and the power of ES6 (ES2015).

Methods are implemented individually and not as part of a whole.

## Installation

There are multiple ways to use Tiny.

### Inline resource (recommended)

Grab [the distributable code](https://github.com/mercadolibre/tiny.js/blob/master/dist/tiny.min.js) and embed into a `<script>` tag just before the `</body>` tag.

### Module

Use NPM or Bower and include Tiny as part of the build process.

```shell
npm install mercadolibre/tiny.js
```

```shell
bower install tiny
```

### From CDN

```html
<script src="//ui.mlstatic.com/chico/tiny/x.x.x/tiny.min.js"></script>
```

Check [releases](https://github.com/mercadolibre/tiny.js/releases) to find the latest version number.


## API

### `tiny.clone(obj)`

Creates a copy of the provided object.

- `obj`: type `Object`. The object to be cloned.

Returns an `Object`.

### `tiny.extend([deep,] target, ...sources)`

**[WIP]**

### `tiny.inherits(obj, superConstructor)`

Inherits the prototype methods from one constructor into another.

The parent will be accessible through the `obj.super_` property.

Fully compatible with standard Node.js `inherits`.

- `obj`: type `Object`. An object that will have the new members.
- `superConstructor`: type `Function`. The constructor Class.

### `tiny.isPlainObject(obj)`

Validates for a valid Object.

- `obj`: type `Object`. The object to be validated.

Returns a `Boolean`.

### `tiny.EventEmitter`

Node's event emitter.

The most relevant methods:

- `on()`
- `once()`
- `emmit()`

**[WIP]**

**See the [external module](https://www.npmjs.com/package/events) and the [docs](https://nodejs.org/api/events.html#events_class_events_eventemitter) for a complete reference.**

### `tiny.DOMEvents`

**[WIP]**

- `on()`:
- `off()`:
- `once()`:
- `trigger()`:


### `tiny.addClass(el, className)`

Adds the specified class to an element

- `el`: An `HTMLElement`
- `className`: `String` The class that should be added to an element

Example:
```js
tiny.addClass(document.body, 'example');
```


### `tiny.removeClass(el, className)`

Removes the specified class from an element

- `el`: An `HTMLElement`
- `className`: `String` The class that should be removed

Example:
```js
tiny.removeClass(document.body, 'example');
```


### `tiny.hasClass(el, className)`

Determines whether is the given class is assigned to an element

- `el`: An `HTMLElement`
- `className`: `String` The class that should be adden to an element

Example:
```js
tiny.hasClass(document.body, 'example'); // => false
```


*Note*: `tiny.addClass`, `tiny.removeClass` and `tiny.hasClass` are the methods
  of a single module named `classList`. It can be imported entirely as
  `import classList from 'tiny.js/modules/classList'` or as a separated methods
  `import {addClass, removeClass, hasClass} from 'tiny.js/modules/classList'`


### `tiny.css(el, key[, value])`

Get the value of a computed style for the first element in set of
{'fraction_non_alphanumeric': 0.14731020613373555, 'fraction_numerical': 0.0016758840288252053, 'mean_word_length': 4.371737173717372, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2513118', 'n_tokens_mistral': 1986, 'n_tokens_neox': 1883, 'n_words': 661}