0.3.1 • Published 8 years ago
halo-client v0.3.1
halo-client
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-client
$> tsd link
The packaged version of halo-client
contains a typings file at halo-client.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-client').create({
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; if Promise support is preferred, you can wrap the clients in your own Promisify wrappers (like bluebird.promisifyAll
). A Promise-based client 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