https://github.com/random-guys/blobber
https://github.com/random-guys/blobber
lib library
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/random-guys/blobber
- Owner: random-guys
- Created: 2019-10-23T10:35:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T13:26:53.000Z (over 3 years ago)
- Last Synced: 2025-02-02T12:35:53.335Z (over 1 year ago)
- Topics: lib, library
- Language: TypeScript
- Size: 300 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blobber 🍅
GoMoney records as Azure blobs.
# Installation
```sh
yarn add @random-guys/blobber
```
or
```sh
npm install @random-guys/blobber
```
## Usage
```ts
const stream = async () => {
try {
const blobber = new Blobber('exports');
//
const uppercaseTransformer = new Transform({
writableObjectMode: true,
readableObjectMode: true,
transform(chunk, encoding, callback) {
this.push({ Name: chunk });
callback();
}
});
const blobPath = join(__dirname, '../../test.csv');
const options: OmiOptions = {
transformer: uppercaseTransformer,
fields: ['Name'],
blobPath
};
const printDownloadUrl = (val: string) => {
console.log(val);
};
blobber.createBlobFromOmi(options, printDownloadUrl);
// add the records to the file
blobber.addRecords([...Array.from({ length: 5 }).keys()].map(i => i));
// null tell the stream we're done adding records
blobber.addRecords([null]);
} catch (error) {
console.log(error);
}
};
stream();
```