oxiapi

2.0.0 • Public • Published

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!

Package Sidebar

Install

npm i oxiapi

Weekly Downloads

0

Version

2.0.0

License

ISC

Unpacked Size

6.62 kB

Total Files

4

Last publish

Collaborators

  • oxta.