npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

teslamock

v1.0.2

Published

Express app that mimics the Tesla REST API for testing

Downloads

31

Readme

teslamock

Version License

An ExpressJS app that mimics (or mocks) the Tesla REST API surface area for local testing and experimentation.

Installation

In order to use the app you must first download and install NodeJS.

A teslamock installable package for npm is now available. To download and install the library and all of its dependencies to a local project directory use the following:

npm install teslamock

You may also install directly from the GitHub source. Either download and unzip the source, or clone the repository.

Remember, whether you install via npm, ZIP source or Git clone you must install the dependencies before using teslamock.

To install dependencies via npm, from the root level of the library directory type:

npm install

This app is under development. New features and bug fixes are being added periodically. To ensure that you have the very latest version of teslamock and it's dependencies be sure to update frequently. To do so, from your project directory type:

npm update

Tesla API Documentation

The Tesla REST API encapusulated by this library was documented through the collaboration of many Tesla owners. Please thank and support them for their efforts. The current REST API documentation can be found at:

http://docs.timdorr.apiary.io/

What's New

  1. Migration from JADE to PUG should be complete. Please report any issues

Known Issues

  1. Auth always succeeds
  2. Model X not yet supported
  3. No support for multiple vehicles

teslamock.js

This is a simple ExpressJS app that mimics the Tesla servers and implements the full REST API surface area. You can write REST clients that talk to teslamock as if it was the Tesla servers.

Additionally there is now a web interface for this app to allow monitoring state changes sent from clients as well as changing the state to test client behavior. To use the web interface point your web browser to http://127.0.0.1:3000.

Note: the app is still fairly basic and in many cases simply returns success results. It does not validate input parameters including the OAuth token and vehicleID. Streaming is not yet emulated. It does now track vehicle state changes on the server. The web interface does not yet allow for changing vehicle state values.

The app has been updated to replace the use of the JADE templating engine. JADE has recently been renamed to PUG and changes were made to the templating system - all templates should now be updated to use the new format.

Usage:

node teslamock.js [options]

Options:

-h, --help               output usage information
-P, --port               port for the server (default: 3000)