tesla-vehicles-api
v0.3.0
Published
A node module for Tesla Vehicles API in Typescript
Downloads
4
Readme
Tesla-Vehicles-Api
A Node module for the Tesla Vehicle Owners API in Typescript.
Documentation
Prerequisites
- Node 10+
Installation
Install the dependencies and devDependencies and start the server.
$ npm install --save tesla-vehicles-api
Usage
import {client} from 'tesla-vehicles-api'; or const CLIENT = require('tesla-vehicles-api').client;
let _client = new CLIENT||client({
username: '[email protected]',
password: 'I<3Ghost'
});
// let _client = new CLIENT||client({
// access_token: '123456789123456789',
// refresh_token: 'asdasdasdasdasdasd'
// });
_client.getToken().then(result => console.log(result)).catch(err => console.error(err));
// Skip this if you already have the token
Enums Usage
import * as TeslaEnum from 'tesla-vehicles-api/dist/types' or const TESLA_ENUM = require('tesla-vehicles-api/dist/types');
Development
Want to contribute? Great! Make a Pr! Open your favorite Terminal and run these commands.
Building for source
To release in javascript. The output is dumped in the dist folder:
$ npm run build
Testing
Uses Jest, Supertest, Chai - Integration Tests needed
npm test