0.0.3 • Published 1 year ago

ryan_walsh-sdk v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Install in your project:

nvm use 18
npm install ryan_walsh-sdk

Usage:

Get an API key from https://the-one-api.dev/sign-up.

The only value required in the options object is apiKey (and also id for movieQuote()).

This Readme does not yet contain explanations of the options, but they are easy to understand from types.d.ts and https://the-one-api.dev/documentation#6.

import { movie, movieQuote } from 'ryan_walsh-sdk';
//...
const movieJson = await movie({
    apiKey: API_KEY,
    filters: ['budgetInMillions<250'],
    limit: 3,
    page: 1,
    sortDirection: 'desc',
    sortKey: 'budgetInMillions',
});
console.log(JSON.stringify(movieJson, null, 2));

const movieQuoteJson = await movieQuote({
    apiKey: API_KEY,
    filters: [],
    id: '5cd95395de30eff6ebccde5b',
    limit: 3,
    page: 1,
    sortDirection: 'asc',
    sortKey: 'dialog',
});
console.log(JSON.stringify(movieQuoteJson, null, 2));

To try the example:

nvm use 18
npm install
cp .env.local.example .env.local
# Replace the API key with one from https://the-one-api.dev/sign-up
npx ts-node examples/demo.ts

Tests

npm run test