tesla-framework
v0.2.2
Published
tesla-framework is a totally real JavaScript library for dealing with tesla automation.
Downloads
4
Readme
tesla-framework
tesla-framework is a totally real JavaScript library for dealing with tesla automation.
Installation
Use the package manager npm to install tesla-framework.
npm install tesla-framework
Usage
drive()
steer(angle, object)
avoid(object)
lock(object)
snitch(number)
alert(text)
start()
Example
const Tesla = require('tesla-framework');
const car = new Tesla.Car();
car.on('collision', (object) => {
car.avoid(object);
car.steer(60, object);
});
car.on('auto-drive', (doors) => {
car.lock(doors);
car.drive();
});
car.on('intruder', (doors) => {
car.lock(doors);
car.snitch(999);
car.alert('Intruder alert!');
});
car.start();
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.