npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@breathecode/api-js-wrapper

v1.0.6

Published

Javascript Wrapper for the BreatheCode API

Readme

BreatheCode API Javascript Wrapper

This javascript wrapper for the BreatheCode API is still under heavy development, if you use it, pelase collaborate by fixing any bugs/issues that you find and making the pull requests.

Instalation

  1. Clone the repository inside your project structure:
$ git clone https://github.com/breatheco-de/api-javascript-wrapper.git

Usage

  1. Import the library on any file where you need to use it
import BC from '../path/to/the/index.js';

// set the 2 paths for the API
BC.setOptions({
  assetsPath: 'http://assets.breatheco.de/apis',
  apiPath: 'http://api.breatheco.de',
  token: 'ASDASDASDASDASASD', //optional
});

// You can also set the token on a separate function, 
// it will be saved in the localStorage if the localStorage is available.
BC.setToken('ASDASDASDASDASASD');

Doing a request

It's always going to be like this:

BC.entity().action(data=null).then(function).catch(function);

The entities can be: syllabus, todo, project, user, student, cohort, location, profile. (more entities will be added soon). The actions in general can be: all, add, delete, update.

Some entities like credentials don't behave the same way and can have special actions like "autenticate" and "remind".

Example Requests

// login
BC.credentials().autenticate(username, password) 
  .then((data) => console.log(data.access_token))
  .catch((error) => console.error(error)); 
  
// login
BC.credentials().remind(username) 
  .then((data) => console.log(data))
  .catch((error) => console.error(error)); 
  
//get all students
BC.student().all() 
  .then((result) => console.log(result.data))
  .catch((error) => console.error(error)); 
  
//get a single student with id 2
BC.student().get(2) 
  .then((result) => console.log(result.data))
  .catch((error) => console.error(error)); 
  
// delete a task with id 2
BC.task().delete(2) 
  .then((result) => console.log(result.data))
  .catch((error) => console.error(error)); 
  
// update a user with id 2 (it can be a student, teacher, etc.)
BC.user().update({
    full_name: 'Mario Jones'
  }) 
  .then((result) => console.log(result.data))
  .catch((error) => console.error(error)); 

//Other examples!

const getAllCohorts = BC.cohort().all();
getAllCohorts.then((results)=>{
    console.log(results);    
});

const getAllEvents = BC.event().all();
getAllEvents.then((events)=>{
    console.log(events);    
});

const getSingleEvent = BC.event().get(6);
getSingleEvent.then((event)=>{
    console.log(event);    
});

const deleteEvent = BC.event().delete(6);
deleteEvent.then((result)=>{
    console.log(result);    
});

const createEvent = BC.event().add({"description":"<p>4Geeks Nights - Learn to Code for Free Coding is no longer a dream. We are closing the gap and bringing coding to your life. A master platform, full oasd exercises and content, for free. To begin, we will give you free access to our Coding Introduction Program, where you will find everything you need to start your training as a software developer. HTML, CSS, Bootstrap, JavaScript and more. This is not only reading, videos, and tutorials, but tons of exercises and projects to work with.We have five -probably more- GREAT reasons why you should be in our 4Geeks Nights event on June 28th.- You will get FREE access to the Coding Intro Program and platform. Learn to Code has never been easy and better;- You will get free mentorship hours every week;- Our Career Support program speaks for itself. You will meet our Alumni; one of them will talk about his projects and experience at 4Geeks!- You will have fun while meeting our entire team &amp; office: Founders, instructors, partners and classroom spaces. Have a drink with us!- You will get the details about our Software Program.<\/p>","title":"4Geeks Nights: INFO+CODING+GAMES+DRINKS","url":"https:\/\/www.eventbrite.com\/e\/4geeks-nights-infocodinggamesdrinks-tickets-46847266435","capacity":"100","logo_url":"https:\/\/pbs.twimg.com\/profile_images\/930433054371434496\/v8GNrusZ_400x400.jpg","event_date":"2018-06-28 18:00:00","type":"intro_to_coding","address":"66 West Flagler Street #900, Miami, FL 33130","location_slug":"mdc-i","lang":"en","city_slug":"mia","banner_url":"http:\/\/placehold.it\/800x400","invite_only":"true","created_at":"2018-06-28 00:13:06","id":"6","status":"draft"});
createEvent.then((result)=>{
    console.log(result);    
});