Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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) instance

It 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).