https://github.com/bigpipe/floppy
Floppy is the file representation for async loaded assets
https://github.com/bigpipe/floppy
Last synced: 10 months ago
JSON representation
Floppy is the file representation for async loaded assets
- Host: GitHub
- URL: https://github.com/bigpipe/floppy
- Owner: bigpipe
- License: mit
- Created: 2014-12-29T22:50:41.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-10-26T13:14:16.000Z (over 5 years ago)
- Last Synced: 2025-05-15T11:52:06.094Z (about 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# floppy
[![Version npm][version]](http://browsenpm.org/package/floppy)[![Build Status][build]](https://travis-ci.org/bigpipe/floppy)[![Dependencies][david]](https://david-dm.org/bigpipe/floppy)[![Coverage Status][cover]](https://coveralls.io/r/bigpipe/floppy?branch=master)
[from]: https://img.shields.io/badge/from-bigpipe.io-9d8dff.svg?style=flat-square
[version]: http://img.shields.io/npm/v/floppy.svg?style=flat-square
[build]: http://img.shields.io/travis/bigpipe/floppy/master.svg?style=flat-square
[david]: https://img.shields.io/david/bigpipe/floppy.svg?style=flat-square
[cover]: http://img.shields.io/coveralls/bigpipe/floppy/master.svg?style=flat-square
Floppy a file representation for assets. It will automatically clean up after it
self after all dependent processes eject it.
## Installation
The module is written with Browserify and Node.js in mind and is released in the
public npm registry. It can be installed by running:
```
npm install --save floppy
```
## Usage
In all examples we assume that you've required and constructed your floppy
instance as following:
```js
'use strict';
var Floppy = require('floppy')
, file = new Floppy('//cdn.example.org/file.ext');
```
### floppy.eject
Remove a dependent from the floppy. If the floppy is still in use by something
it will prevent ejection and return false. Once all the last dependent is
removes it self the floppy will be fully eject and call `floppy.destroy`
```js
floppy.eject();
```
## License
MIT