This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

cocovoit

1.2.0 • Public • Published

Simple carpooling library

This is a simple test of a carpooling library, built with node and some ♥.

Resources

Working with the library

This library is a simple project to build something (re)usable with tests.

const Coco = require("cocovoit");
const Carpooling = new Coco();

// Build options for a journey
const options = {
  kms: 35.5,
  price_per_kms: 1.62,
  passengers: [],
  comeBack: true,
  conductor: "ugo",
  car: {
    model: "308",
    brand: "Peugeot",
    consumption: 7
  }
};

// Create a journey
const journey = P.createJourney(options);

// Create a passenger
const uPassenger = P.createPassenger({ name: "ugo", age: 28 }, { number_per_week: 5, comeBack: true });

// Add a passenger
journey.addPassengers(uPassenger)
const passengersList = journey.passengersList;

// Get the passengers of a journey
const numberOfPassengers = journey.passengersList;

// Get the price per passenger for a journey
const pricePerPassenger = journey.calculate();

console.log("All the Journey details", journey);

See in the examples/ folder to see more ways on how to play with the library.

Working on the library

git clone git@github.com:Ugarz/cocovoit.git
cd cocovoit
npm start          // Run the example code
npm run dev        // Run a live server to play around (you can edit examples/example-1.js in live mode)
npm test           // Run the tests
npm run test:live  // Run the tests, live

Cocovoit - Les Lopez

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i cocovoit

    Weekly Downloads

    0

    Version

    1.2.0

    License

    ISC

    Unpacked Size

    18.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • ugarz