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

lurchr-api

v2.7.5

Published

API module for lurchr that mostly just handles the database layer.

Downloads

5

Readme

lurchr-api

API module for lurchr that mostly just handles the database layer.

Usage

const api = require('lurchr-api')();

api.teams.get('T123123', function (err, team) {
  if (err) throw err;

  console.log(team);
});

Methods

api.teams.upsert(teamId, team, cb)

Upserts a team.

api.teams.get(teamId, cb)

Returns a team or null.

api.teams.getByDomain(domain, cb)

Returns a team from a domain name.

api.teams.allActive(cb)

Returns all active teams.

api.teams.all(cb)

Returns all teams on lurchr.

api.teams.getNotBackfilled(cb)

Returns one team that have not been initialized.

Sets a lock for 15 minutes. If needed refresh the lock by using refreshLock

api.teams.refreshLock(teamId, cb)

Sets the lock for a team for 15 minutes.

api.users.upsert(teamId, userId, user, cb)

Upserts a user in a team.

api.users.upsertMany(teamId, users, cb)

Upserts many users. Each user should have an id property set.

api.users.get(teamId, userId, cb)

Returns a user in a team.

api.users.getByName(teamId, name, cb)

Returns a user by using the username.

api.users.all(teamId, cb)

Returns all users in a team.

api.channels.upsert(teamId, channelId, channel, cb)

Upserts a channel in a team.

api.channels.upsertMany(teamId, channels, cb)

Upserts many channels. Each channel should have an id property set.

api.channels.get(teamId, channelId, cb)

Returns a channel in a team.

api.channels.all(teamId, cb)

Returns all channels in a team.

api.channels.addUser(teamId, channelId, userId, cb)

Adds a user to a channel's members list.

api.channels.removeUser(teamId, channelId, userId, cb)

Removes a user from a channel's members list.

api.emojis.upsert(teamId, emojiId, emoji, cb)

Upserts an emoji in a team.

api.emojis.upsertMany(teamId, emojis, cb)

Upsert many emojis in a team. Each emoji should have an id property set.

api.emojis.get(teamId, emojiId, cb)

Return the url/alias to the given emoji.

api.emojis.deleteMany(teamId, emojis, cb)

Deletes many emojis in a team. emojis should just be an array with emojiID's.

api.links.upsert(teamId, linkId, link, cb)

Upserts a link in a team.

api.links.get(teamId, linkId, cb)

Returns a link from a given id.

api.links.search(teamId, options, cb)

Performs a search. Options can be many different things. All can be combined.

  • options.size Number of results. Defaults to 20.
  • options.skip Number of results to skip. Defaults to 0.
  • options.channels Channel ID's to limit to
  • options.users User ID's to limit to
  • options.links Link ID's to limit to
  • options.fromDate A UNIX timestamp to limit to
  • options.toDate A UNIX timestamp to limit to
  • options.text Perform a full-text search on description, title, and partly the page content

api.links.markAsRead(teamId, userId, linkId, cb)

Add the userId to .read[] and remove from .unread[].

api.links.markAsUnread(teamId, userId, linkId, cb)

Add the userId to .unread[] and remove from .read[].

api.links.markChannelAsRead(teamId, channelId, userId, cb)

Add the userId to .read[] in all links with the channelId.

api.links.all(teamId, cb)

Get all links for a team.

api.links.getUnreadCountByChannel(teamId, channelId, userId, cb)

Return the number of links the userId haven read in channelId.

api.links.initUnreadStatus(teamId, linkId, ts, cb)

First checks to see if ts is less than 7 days old. If not it's ignored.

Adds all registered user on teamId to .unread[] on linkId

api.links.initUserUnreadStatus(teamId, userId, cb)

Inits a user by going through all links on the team, and adds the user to .unread[].

All links less than 7 days old or posted by userId is ignored.

api.stars.add(teamId, userId, linkId, cb)

Adds userId to linkId's .starred[].

api.stars.remove(teamId, userId, linkId, cb)

Removes userId from linkId's .starred[].

api.stars.all(teamId, userId, cb)

Returns an array of link ID's that the userId have starred.