How to use stream-events - 1 common examples

To help you get started, we’ve selected a few stream-events examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanderhelleso / klourly / node_modules / gcs-resumable-upload / build / src / index.js View on Github external
constructor(cfg) {
        super();
        this.numBytesWritten = 0;
        this.numRetries = 0;
        streamEvents.call(this);
        cfg = cfg || {};
        if (!cfg.bucket || !cfg.file) {
            throw new Error('A bucket and file name are required');
        }
        cfg.authConfig = cfg.authConfig || {};
        cfg.authConfig.scopes =
            ['https://www.googleapis.com/auth/devstorage.full_control'];
        this.authClient = cfg.authClient || new google_auth_library_1.GoogleAuth(cfg.authConfig);
        this.bucket = cfg.bucket;
        this.file = cfg.file;
        this.generation = cfg.generation;
        this.kmsKeyName = cfg.kmsKeyName;
        this.metadata = cfg.metadata || {};
        this.offset = cfg.offset;
        this.origin = cfg.origin;
        this.userProject = cfg.userProject;

stream-events

Get an event when you're being sent data or asked for it.

MIT
Latest version published 6 years ago

Package Health Score

65 / 100
Full package analysis

Popular stream-events functions