Skip to content

codebottle-io/codebottle-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeBottle

Snippets Stats discord guild version Build Status downloads

Install

npm i codebottle

yarn add codebottle

Usage

All requests return Promise

For examples see test/index.mjs

import bottle from 'codebottle';

// ...

const data = await bottle.latest;
const { id, code, title, username } = await bottle.fetch('f063cc6e0b');

// advanced api wrapper (without docs)
// recommended to not use it unless you know how to use it
const data = await bottle.api.snippets('f063cc6e0b').get();

All library methods and getters

// Fetch specific snippet by key
bottle.fetch(key)

// Fetch language or category by key
bottle.language(key);
bottle.category(key);

// Find snippets with query and with optional language id
bottle.search({ query, language })

// Fetch latest snippets
codebottle.latest;

// Fetch all languages or categories
codebottle.languages;
codebottle.categories;

About

A Node.js library to interact with CodeBottle's API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published