sproutsocial / walltime-js

A JavaScript library for easily translating a UTC time to a "Wall Time" for a particular time zone.
MIT License
121 stars 12 forks source link

Make a data file that can be loaded in node #36

Closed jgable closed 10 years ago

jgable commented 11 years ago

Consumers of this library in node have trouble loading the data and have to resort to hacky workarounds.

We should create the large walltimeData and individual data files for loading by the library and put them in the lib/data/ folder. JavaScript will be fine instead of CoffeeScript since we already have the infrastructure to do that.

We should also figure out a way to have the node module pre-load the data when required so people don't have to.

mattjohnsonpint commented 11 years ago

Also should make sure links to eggert/tz are updated to point at current release versions.

Currently it's pointed at d4266a8cac which is somewhere in between 2013b and 2013c.

The current 2013d release is at 8f10e5c535

jgable commented 10 years ago

Just to follow up about how this is now handled. The data files that are built now will be able to be used with require(). Either by copying a specific data file to your repo or trying out the deeplinking in require natively something like:

var wallTimeData = require("walltime-js/client/walltime-data");

This is published as version 0.1.2 on NPM, so make sure your package.json semver specification for walltime allows for the minor bump we had to 0.1.x.