https://github.com/itaibo/momoa
Operations with JSONs
https://github.com/itaibo/momoa
etl gzip json
Last synced: 2 months ago
JSON representation
Operations with JSONs
- Host: GitHub
- URL: https://github.com/itaibo/momoa
- Owner: itaibo
- Created: 2022-11-29T12:33:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-29T18:13:34.000Z (over 3 years ago)
- Last Synced: 2025-10-20T06:27:08.363Z (9 months ago)
- Topics: etl, gzip, json
- Language: TypeScript
- Homepage: https://npmjs.com/momoa
- Size: 215 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Momoa

Operations with JSONs
## Usage
Install the package:
```sh
npm install momoa
```
Then import it in your application and start an instance
```js
import Momoa from 'momoa';
const momoa = new Momoa();
```
### Enlist JSON Array
```js
const multilineString = await momoa.enlist([{ test: 1 }, { test: 2 }, { test: 3 }]).output();
console.log(multilineString);
```
Output would be:
```txt
{"test":1}
{"test":2}
{"test":3}
```
### Unlist JSON String
```js
const array = await momoa.unlist("{\"test\":1}").json();
console.log(array);
```
Output would be:
```json
[
{ "test": 1 }
]
```
### Gzip results
```js
const gzipped = await momoa.enlist([{ test: 1 }, { test: 2 }, { test: 3 }]).gzip().end();
console.log(gzipped);
```
Output would be:
```txt
```
### UnGzip
```js
const uncompressed = await momoa.ungzip(BUFFER).end();
console.log(uncompressed);
```
Output would be:
```txt
{"test":1}
{"test":2}
{"test":3}
```
#### Special thanks
Chaining async functions: [Proxymise](https://www.npmjs.com/package/proxymise)