New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@cordis/rest

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cordis/rest

Cordis' REST utilities for the Discord API

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
17
-51.43%
Maintainers
1
Weekly downloads
 
Created
Source

@cordis/rest

GitHub npm TypeScript

Cordis' REST utilities for the Discord API

Note: Props to https://github.com/spec-tacles/spectacles.js for the Mutex logic.

Installation

  • npm install @cordis/rest
  • pnpm install @cordis/rest
  • yarn add @cordis/rest

Example Usage

const { Rest, buildRestRouter } = require('@cordis/rest');

const main = async () => {
  const rest = new Rest('token');
  const router = buildRestRouter(rest);

  // using the rest manager itself
  const someUser = await rest.get('/users/223703707118731264');
  const someOtherUser = await rest.make({
    path: '/users/198536269586890752',
    method: 'get'
  });

  // using the router utility
  const someOtherOtherUser = await router.users["223703707118731264"].get();

  console.log(someUser, someOtherUser, someOtherOtherUser);
};

main();

Documentation

You can find documentation for the whole project over at https://cordis.js.org

Contributing

Please see the main README.md for info on how to contribute to this package or the other @cordis packages.

LICENSE

Licensed under the Apache 2.0 license.

FAQs

Package last updated on 24 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts