UNPKG

tinify

Version:

Node.js client for the Tinify API. Tinify compresses your images intelligently. Read more at https://tinify.com.

25 lines (24 loc) 737 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const compat_1 = require("./compat"); const intify = (v) => parseInt(v, 10); class ResultMeta { /** @internal */ constructor(meta) { this._meta = meta; } /** @internal */ meta() { return this._meta; } width(callback) { return (0, compat_1.nodeify)(this.meta().then(meta => intify(meta["image-width"])), callback); } height(callback) { return (0, compat_1.nodeify)(this.meta().then(meta => intify(meta["image-height"])), callback); } location(callback) { return (0, compat_1.nodeify)(this.meta().then(meta => meta["location"]), callback); } } exports.default = ResultMeta;