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

flattr

v0.7.3

Published

Module for communicating with the Flattr API.

Readme

NodeJS module for the Flattr API

Flattr this git repo

Under heavy development. Give me a couple of more days and this one will become completed.

Status:

  • flattr.flattrs OK
  • flattr.things OK
  • flattr.users FAIL
  • flattr.activities TODO
  • flattr.categories TODO
  • flattr.languages TODO

Get Started

Require the flattr module:

var flattr = require('flattr');

List an authenticated users flattrs:

// First get your auth code by visiting:
// https://flattr.com/oauth/authorize?response_type=code&client_id=<app_key>
//
var app = {
    client_id: '<app_key>',
	client_secret: '<app_secret>',
	// Must match your apps  callback url:
	redirect_uri: 'http://localhost:8080/flattr'
};

flattr.request_token(app, code, function (token) {
	flattr.flattrs.list_auth(token, function (flattrs_list) {
	    // do something
	});
});

List a users (flattr) three latest flattrs:

flattr.flattrs.list('flattr', {count: 3}, function (flattrs) {
    // do something
});

API

Flattrs

Resource for listing a users flattrs and to flattr things.

http://developers.flattr.net/api/resources/flattrs/

var flattrs = require('flattr').flattrs;

flattrs.list(user, [obj], callback)

List a users flattrs. obj.count default to 30 and tells Flattr number of records to retrieve, obj.page defaults to 1.

flattrs.list('flattr_user', {count: 5}, function (data) {
    console.log(data);
});

flattrs.list_auth(token, [obj], callback)

List an authenticated users flattrs. obj.count default to 30 and tells Flattr number of records to retrieve, obj.page defaults to 1.

flattrs.list_auth(token, function (data) {
    console.log(data);
});

flattrs.thing(token, id, callback)

Flattr a thing with id of id.

flattrs.id(token, 423405, function (data) {
    console.log(data);
});

flattrs.url(token, url, user, [obj], callback)

Flattr an URL. obj holds optional query parameters for the auto-submit url.

var params = {
    title: 'Optional title',
	description: 'Description of your thing',
	// https://api.flattr.com/rest/v2/languages.txt
	language: 'en_GB',
	tags: 'yoga, top10, poses',
	// 1 to hide from public listings
	hidden: 1,
	// https://api.flattr.com/rest/v2/categories.txt
	category: 'text'
};

// With or without http/https is accepted.
flattrs.url(token, 'womenshealthmag.com/yoga/top-10-yoga-poses-for-men', 'flattr_user', params, 
    function (data) {
        console.log(data);
    }
);

Things

A resource to list, add, update and search for things.

http://developers.flattr.net/api/resources/things/

var flattrs = require('flattr').things;

things.list(user, [obj], callback)

List a users things. obj.count default to 30 and tells Flattr number of records to retrieve, obj.page defaults to 1.

things.list('flattr', { count: 10 }, function (data) {});

things.list_auth(token, [obj], callback)

List the authenticated users things.

things.get(id, [token], callback)

Get a thing with id of id or multiple things as an array of id's. Supplying a token should give extra data if resource owner owns the thing.

things.get(12345, function (data) {});

things.exists(url, [autosubmit], callback)

Check if a thing exists. If autosubmit == true it checks an auto submit url.

things.exists('http://github.com/antics/node-flattr', function (data) {});

things.create(token, url, [obj], callback)

Create a thing with the url url and submit optional extra information in obj.

var params = {
    title: 'NodeJS module for the flattr API',
	tags: 'nodejs,flattr'
};

things.create(token, 'github.com/antics/node-flattr', params, function (data) {});

things.update(token, id, [obj], callback)

Update a thing with the id id.

things.del(token, id, callback)

Delete thing with id id.

things.del(token, '1234', function (data) {
    // if ok, data.message == 'ok'
});

things.search(params, callback)

Search for things. params holds object with search parameters. See http://developers.flattr.net/api/resources/things/#search-things

Licence

Copyright (C) 2012 Humanity

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.