2.0.0 • Published 6 months ago

oxiapi v2.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

oxiapi

The easiest way to interact with The OxiAPI, a spanish API.

Table of contents

Installation

npm install oxiapi

Example

const api = require('oxiapi');

(async () => {
    const data = await api.json.translate(null, 'en', '¡Hola!'); // 1st parameter is "from" (from what language to translate), if you leave it undefined or 'null', it'll use auto language detection.
    console.log('Result: ' + JSON.stringify(data));
});

Available endpoints

Note: parameters including '?' at the end means they're optional.

  • JSON:
    • fact - Returns a random fact (in spanish)
    • translate(from, to, text) - Translates given text to another language.
    • calculate(expr) - Solves a math expression.
    • npm(packagename) - Get info about a NPM package.
    • formatDate(timestamp, format, uselowcase?) - Format a date to nearly any format you want.
  • Image:
    • Coming soon!

2.0.0

6 months ago

1.0.1

9 months ago

1.0.0

9 months ago