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 🙏

© 2024 – Pkg Stats / Ryan Hefner

freeboxos

v0.0.1

Published

Freeboxos for nodejs

Downloads

5

Readme

FreeboxOS Api - NodeJS module

A NodeJS module for the new FreeboxOS API.

Please read also the doc : http://dev.freebox.fr/sdk/os.

Please consider it as a draft.

Connect & register

###freebox.connect(); You can start to use the module with these lines of code :

  var freebox = require('./freebox/freebox'); 

  freebox.connect();
  
  freebox.on('ready', function(box) {
  
    //Some stuff
  
  });
  

You could also pass params. For example if you want to specifiy the address of the box, or if you alredy have an app_token for your app.

freebox.connect({
  'ip'        : 'mafreebox.freebox.fr', (optional)
  'port'      : 80, (optional)
  'app_token' : '012345', (optional)
  'track_id'  : '12' (optional)
});

freebox.register();

Before doing anything, you need to declare the app to the Freebox. A message will be prompt on the lcd screen asking the user to accept or deny.

freebox.register();

On can save appToken, trackId and status by listening at :

freebox.on('registered', function(params) {
  console.log(params);
});

Stats

freebox.stats(db, date_start, date_end, precision, fields, next)

Echo freebox's stats. Example :

freebox.stats(temp, null, null, null, null, function(msg) {
  console.log(msg);
});

date_start, date_end, precision and fields are optional. Please see http://dev.freebox.fr/sdk/os/rrd/ for all the options.

Downloads

freebox.downloadsStats(next)

Echo download stats with :

freebox.downloadsStats(function(msg){
  console.log(msg);
});

addDownloads(url, dir, recursive, username, password, archive_password, next)

'Url' can be multiple. In this case, they have to be separated by a new line delimiter "\n" as below.

freebox.addDownloads(
  "http://blog.baillet.eu/public/ciel-bleu-sans-avion-20100417-imgis5346.jpg\nhttp://www.8alamaison.com/wp-content/uploads/2013/04/z2354-carton-rouge3.gif",
  null, false, null, null, null,
  function(msg) {
    console.log(msg);
  }
 );

downloads(id, action, params, next)

You can manage download.
With no id submitted it returns the entire downloads list. With an id you can manage the selected download.

Actions :

  • read (default)
  • log
  • udpate (needs 'params', see below)
  • delete
  • deleteAndErase (delete the download and erase the files downloaded)
freebox.downloads(2, udpate, {"io_priority": "high","status": "stopped"}, function(msg){
  console.log(msg);
});

Calls

freebox.calls(next);

Return all the calls save in the box.

freebox.calls(function(msg){
  console.log(msg);
});

freebox.call(id, action, params, next)

Manage a call. Actions :

  • Read (default)
  • update
  • delete

Example : read a specific call

freebox.call(1, 'read', null, function(msg) {
  console.log(msg);
});

Example : update a call

freebox.call(1, 'update', {'new' : false}, function(msg) {
  console.log(msg);
});