Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/get-zonetab
Get the latest zone.tab file form IANA time zone database
https://github.com/shinnn/get-zonetab
Last synced: 27 days ago
JSON representation
Get the latest zone.tab file form IANA time zone database
- Host: GitHub
- URL: https://github.com/shinnn/get-zonetab
- Owner: shinnn
- License: mit
- Created: 2016-06-06T11:48:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-14T08:13:21.000Z (almost 6 years ago)
- Last Synced: 2024-09-15T09:51:33.260Z (2 months ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# get-zonetab
[![npm version](https://img.shields.io/npm/v/get-zonetab.svg)](https://www.npmjs.com/package/get-zonetab)
[![Build Status](https://travis-ci.org/shinnn/get-zonetab.svg?branch=master)](https://travis-ci.org/shinnn/get-zonetab)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/get-zonetab.svg)](https://coveralls.io/github/shinnn/get-zonetab?branch=master)A [Node.js](https://nodejs.org/) module to get the latest [`zone.tab`](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) file form [IANA Time Zone Database](https://www.iana.org/time-zones)
```javascript
const getZonetab = require('get-zonetab');getZonetab().then(string => {
string; //=> '# tz zone descriptions (deprecated version)\n ...'
});
```## Installation
[Use npm.](https://docs.npmjs.com/cli/install)
```
npm install get-zonetab
```## API
```javascript
const getZonetab = require('get-zonetab');
```### getZonetab([*options*])
*options*: `Object`
Return: [`Promise`](http://www.ecma-international.org/ecma-262/6.0/#sec-promise-constructor) instanceIt gets and extracts `zone.tab` file form and returns a promise for a string of file contents.
#### Options
All options except for `encoding` will be directly used as [`Request` options](https://github.com/request/request#requestoptions-callback).
##### options.encoding
Type: `String` or `null`
Default: `utf8`Determine the encoding of the stirng or get a [`Buffer`](https://nodejs.org/api/buffer.html#buffer_buffer) instead if this option is `null`.
```javascript
getZonetab({encoding: null}).then(buffer => {
buffer; //=>
});
```## License
Copyright (c) 2016 - 2018 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).