Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/arnaudjuracek/pinp

PINP is not packery
https://github.com/arnaudjuracek/pinp

drag-and-drop grid javascript packing

Last synced: 13 days ago
JSON representation

PINP is not packery

Awesome Lists containing this project

README

        

# `pinp`
> `pinp` is not packery


## Usage
##### Import with a module bundler

```console
$ npm install --save pinp
```

```js
// using ES6 module
import pinp from 'pinp'

// using CommonJS module
var pinp = require('pinp')
```

##### Import from a browser

```html

// window.pinp is exposed

```

### Quickstart
```js
import pinp from 'pinp'

const grid = pinp('.pinp-container')

const elements = document.querySelectorAll('.pinp-element')
for (let i = 0; i < elements.length; i++) {
grid.add(elements[i])
}

grid.update()
```
See [`example`](example/) for a detailed implementation.

## API

See [docs/API](docs/API.md).

## Development
```console
$ npm install # install all npm dependencies
$ npm run start # start the dev server with livereload on the example folder
$ npm run build # bundle your library in CJS / UMD / ESM
$ npm run test # lint your js inside the src folder

$ npm version [major|minor|patch] # bundle, create a new release, publish to npm and deploy example/ to gh-page
```

## License
[MIT.](https://tldrlegal.com/license/mit-license)