@mapbox/tiletype
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

tiletype

build status Coverage Status

detect common map tile formats from a buffer

type(buffer)

Given a buffer of unknown data, return either a format as an extension string or false if the type cannot be determined.

Potential options are:

  • png
  • pbf
  • jpg
  • webp

Parameters

parameter type description
buffer Buffer input

Returns String,boolean, identifier

headers(buffer)

Return headers - Content-Type and Content-Encoding - for a response containing this kind of image.

Parameters

parameter type description
buffer Buffer input

Returns Object, headers

dimensions(buffer, dimensions)

Determine the width and height of an image contained in a buffer, returned as a [x, y] array.

Parameters

parameter type description
buffer Buffer input
dimensions Array,boolean

Installation

Requires nodejs.

$ npm install @mapbox/tiletype

Tests

$ npm test

Readme

Keywords

none

Package Sidebar

Install

npm i @mapbox/tiletype

Weekly Downloads

2,561

Version

0.3.1

License

none

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user