0.2.4 • Published 5 years ago

@random-guys/blobber v0.2.4

Weekly downloads
20
License
ISC
Repository
-
Last release
5 years ago

Blobber 🍅

GoMoney records as Azure blobs.

Installation

yarn add @random-guys/blobber

or

npm install @random-guys/blobber

Usage

const stream = async () => {
  try {
    const blobber = new Blobber<Number>('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<string> = {
      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();
0.2.4

5 years ago

0.2.3

5 years ago

0.2.1

5 years ago

0.2.2

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago