0.2.0 • Published 8 years ago
halo-api-js v0.2.0
halo-api-js
Node and browser client for the halo developer apis https://developer.haloapi.com. Written in TypeScript and includes generated typings.
Installing
$> npm install --save halo-api-js
$> tsd link
The packaged version of halo-api-js
contains a typings file at halo-api-js.d.ts
which you can consume automatically with tsd link
.
Alternatively, you can add a reference to that definition file manually in your tsconfig
or from your project code.
Using
var halo = require('halo-api-js').createHaloApi({
apiToken: <token>
});
halo.getMetadataMaps(function(err, maps) {
console.log('I got me some maps!', maps);
});
Only a node-style callbacks API is exported right now, but feel free to add your own Bluebird wrappers. A Promise-based wrapper may be included in the future.
Developing
I highly recommend a TypeScript-aware editor like Microsoft Visual Studio Code or JetBrains WebStorm.
Visual Studio Code setup
- Download Visual Studio Code
- Open the project directory
- Write code
Testing
$> HALO_API_TOKEN=<token> npm test