scp-api.js
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

scp-api.js

CodeFactor NPM-Version NPM-Downloads Github Stars Issues

This a wrapper/scrapper of the SCP Fandom site.

There is no API key required.

To install use:

npm i scp-api.js

There is two ways to fetch data.

You can use the method fetchSCP without creating an API instance first, or you can create and API instance and use getSCP to take adventage of local cache data.

Here you have the two examples:

import { API, fetchSCP } from './src';

console.log('---- Direct Method: ----')
const scp3007 = await fetchSCP('3007')
console.log({ scp3007 })

console.log('---- Cache Method: ----')
const api = new API();
const first = await api.getSCP('3007');
const second = await api.getSCP('982');
console.log('results: ', {
    first,
    second,
})
console.log('cache: ', api.raw)

Disclaimer

This project is fully made for educational purposes

Package Sidebar

Install

npm i scp-api.js

Weekly Downloads

1

Version

2.0.0

License

GPL-3.0

Unpacked Size

56.7 kB

Total Files

9

Last publish

Collaborators

  • ifraan_