1.1.18 • Published 4 years ago

dinosaurio v1.1.18

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Dinosaurio

npm npm

Dinosaurio is a simple package which exports Dinosaur information.

Installation

Install from the NPM registry with NPM itself, or with Yarn:

# NPM:
npm install dinosaurio

# or Yarn:
yarn add dinosaurio

Importing

You can import the package with ES6-style imports, or through Node's require:

//ES6-style import
import {
  import {
  getDino,
  getDinos,
  getRandomDino,
  getDinosPerPeriod,
  getDinosPerDiet,
  getDinosPerWeight,
  getDinosPerLength,
} from 'dinosaurio';

//Require
const dinosaurio = require('dinosaurio');

Usage

import express from 'express';
import { Dinosaurs } from 'dinosaurio/lib/Dinosaurs';
import Dinosaur from 'dinosaurio/lib/model/Dinosaur';
import { getDinos } from 'dinosaurio';
const dinoApi = express.Router();

dinoApi.get('/', (req, res) => {
  res.send(Dinosaurs);
});
dinoApi.get('/a', (req, res) => {
  const dinos: Dinosaur[] = getDinos();
  res.send(dinos);
});
export default dinoApi;

Contributions

Add new dinosaurs

The template is quite simple, just fetch the data, create a DinosaurName.ts file under src/dinosaurs and import it to src/Dinosaurs.ts.

Extra functionalities

Modify index.ts under src, to add extra functions.

1.1.18

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.4

4 years ago

1.1.0

4 years ago

1.1.2

4 years ago

1.0.1

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago