How to use the apify-client/build/utils.parseBody function in apify-client

To help you get started, we’ve selected a few apify-client 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 apifytech / apify-js / src / key_value_store.js View on Github external
async getValue(key) {
        validateGetValueParams(key);

        await this.initializationPromise;

        try {
            const result = await this._handleFile(key, readFilePromised);
            return result
                ? parseBody(result.returnValue, mime.getType(result.fileName))
                : null;
        } catch (err) {
            throw new Error(`Error reading file '${key}' in directory '${this.localStoragePath}' referred by ${ENV_VARS.LOCAL_STORAGE_DIR} environment variable: ${err.message}`); // eslint-disable-line
        }
    }

apify-client

Apify API client for JavaScript

Apache-2.0
Latest version published 16 days ago

Package Health Score

84 / 100
Full package analysis