1.0.3 • Published 9 years ago

fr-gas-price v1.0.3

Weekly downloads
2
License
Unlicense
Repository
github
Last release
9 years ago

fr-gas-price npm version

Retrieve French gas price data from government website.

Overview

fr-gas-price is a library and a CLI tool to get the latest gas prices by gas type and region, in France.

Usage

fr-gas-price [options] <gas> <postcode>...

Arguments

NameDescription
<gas>The gas type (name or ID, see below).
<postcode>One or more postcodes to fetch prices for.

Options

NameDescription
-p, --prettyShow a pretty table instead of raw output.

Gas

NameDescription
diesel1
unleaded952
e853
gplc4
unleaded95e105
unleaded986

Node

import { gas, gasPrice } from 'fr-gas-price'

const display = ({ city, name, brand, price, updated }) =>
  doStuffWith(city, name, brand, price, updated)

gasPrice(gas.unleaded95, ...[38100, 38200])
  .then(prices => prices.forEach(display))

Bugs

  • The pagination is not supported. Only the first page per postcode is shown.