Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voodoos/bs-jszip
Bucklescript bindings for JSZip
https://github.com/voodoos/bs-jszip
Last synced: about 2 months ago
JSON representation
Bucklescript bindings for JSZip
- Host: GitHub
- URL: https://github.com/voodoos/bs-jszip
- Owner: voodoos
- License: mit
- Created: 2018-05-18T12:34:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-30T15:38:14.000Z (over 6 years ago)
- Last Synced: 2024-12-14T21:11:45.596Z (about 2 months ago)
- Language: OCaml
- Size: 28.3 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bs-jszip
A set of Bucklescript bindings for [JSZip](https://stuk.github.io/jszip/).
Required bindings for [Blob](https://developer.mozilla.org/fr/docs/Web/API/Blob) are also included.
You can find a example usage of theses bindings in the ElpIDE project : [source](https://github.com/voodoos/ElpIDE/src/components/subcomponents/loadModal.re) || [demo](https://voodoos.github.io/ElpIDE/)
## Example usage
```reason
let readZip = f =>
/* Locally open zip module */
Zip.(
create()
/* Load from blob */
|. loadAsync(`blob(f))
|> Js.Promise.then_(zip => {
zip
|. forEach((_relativePath, zipEntry) =>
zipEntry
/* Read each file in zip */
|. Object.asyncString()
|> Js.Promise.then_(content => {
/* Do something */
Js.log(content);
Js.Promise.resolve(content);
})
|> ignore;
);
Js.Promise.resolve(zip);
})
|> ignore
);
```## Introduction
These binding are not complete but in a very usable state. Please fill a issue or make a pull request if there are feature you miss !
## Installation
To use these bindings in an existing ReasonReact project simply add the repository to your dependencies :```
yarn add "https://github.com/voodoos/bs-jszip"
```And ask `bsb` to use it by adding `bs-jszip` to `bs-dependencies` in your `bsconfig.json`.
## Contributions
All contributions are welcomed.
## LICENSE
MIT (see LICENSE file for more details)