Skip to content

teslahunt/inventory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d5d6888 · Aug 28, 2024
Jul 4, 2024
May 30, 2024
Aug 28, 2024
Dec 30, 2023
May 13, 2022
Aug 4, 2020
Aug 4, 2020
May 30, 2024
Aug 28, 2024
Aug 4, 2020
Dec 20, 2023
Aug 28, 2024

Repository files navigation



Last version NPM Status

Retrieve real-time data from Tesla Inventory.

Install

$ npm install tesla-inventory --save

Usage

const createTeslaInventory = require('tesla-inventory')

const fetcher = url => fetch(url).then(res => res.text())

const teslaInventory = createTeslaInventory(fetcher)

teslaInventory('fr', {
  model: 's',
  condition: 'used'
}).then(results => console.log(results))

API

teslaInventory(fetcher)

fetcher

Required
Type: function

The fetcher function used for performing the networking calls. It should return text (example).

.teslaInventory([inventory], [query], [fetcherOpts])

inventory

Required
Type: string

The Tesla Inventory identifier, see inventories.

query

Type: object

The query options to be passed agaisnt Tesla Inventory API.

These options can be:

  • arrangeby: Price
  • condition: used|new
  • model: ms|mx|m3
  • order: asc|desc

fetcherOpts

Type: object

The options to be passed against fetcher.

License

tesla-inventory © Tesla Hunt, released under the MIT License.
Authored and maintained by Tesla Hunt with help from contributors.

teslahunt.io · GitHub teslahunt · Twitter @teslahuntio