Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ernestmarcinko/domini

A minimalistic HTML document manipulation and traversal javascript library using a jQuery-like syntax.
https://github.com/ernestmarcinko/domini

dom dom-manipulation dom-manipulations dom-traversal ecmascript6 es6 html jquery minimalistic xhr xhr-requests

Last synced: 2 months ago
JSON representation

A minimalistic HTML document manipulation and traversal javascript library using a jQuery-like syntax.

Awesome Lists containing this project

README

        

# [DoMini](https://dominijs.com) · ![npm](https://img.shields.io/npm/v/domini) ![npm](https://img.shields.io/npm/dy/domini) ![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)

A minimalistic HTML document manipulation and traversal tool. Syntactically indentical to jQuery, but much smaller with only the essential features.

Check out the [documentation](https://dominijs.com) for all the features.

## Installation
Use npm or yarn to install DoMini with a single command

```shell
# with npm
npm i domini --save-dev

# with yarn
yarn add domini
```

### In code

Complete library:

```javascript
import DoMini from domini;

DoMini(function($){
//.. do your thing
});
```

Core and optional modules:

```javascript
import "domini/dist/domini-core";
import "domini/dist/domini-animate";
import "domini/dist/domini-highlight";
import "domini/dist/domini-serialize";
import "domini/dist/domini-viewport";
import "domini/dist/domini-xhttp";

DoMini(function($){
//.. do your thing
});
```

## Via CDN

If you prefer a build, use the CDN version (all features)

```html

```

..or individually (core + modules):

```html

// You can optionally load more modules after the core if you need them:

```

## Sample Usage
DoMini loads itself to the ```DoMini``` variable in the global namespace.

```javascript
// Similarly to jQuery
DoMini('#selector').text('Hi!');

// If you prefer $
const $ = DoMini;
$('#selector').text('Hi!');

// Or much better in a scope
(function($){
$('#selector').text('Hi!');
})(DoMini);

// Fires on DOMContentLoaded or immediately if DOMContentLoaded was fired
DoMini(function($){
$('#selector').text('Hi!');
});
```