Skip to content

shinnn/get-zonetab

Repository files navigation

get-zonetab

npm version Build Status Coverage Status

A Node.js module to get the latest zone.tab file form IANA Time Zone Database

const getZonetab = require('get-zonetab');

getZonetab().then(string => {
  string; //=> '# tz zone descriptions (deprecated version)\n ...'
});

Installation

Use npm.

npm install get-zonetab

API

const getZonetab = require('get-zonetab');

getZonetab([options])

options: Object
Return: Promise instance

It gets and extracts zone.tab file form https://www.iana.org/time-zones and returns a promise for a string of file contents.

Options

All options except for encoding will be directly used as Request options.

options.encoding

Type: String or null
Default: utf8

Determine the encoding of the stirng or get a Buffer instead if this option is null.

getZonetab({encoding: null}).then(buffer => {
  buffer; //=> <Buffer 23 20 74 7a 20 7a 6f 6e 65 20 64 65 73 63 72 ... >
});

License

Copyright (c) 2016 - 2018 Shinnosuke Watanabe

Licensed under the MIT License.

About

Get the latest zone.tab file form IANA time zone database

Resources

License

Stars

Watchers

Forks

Packages

No packages published