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

hashdo-web

v0.1.94

Published

Expose #Do functionality through a web API.

Downloads

253

Readme

#Do Web

Expose #Do functionality through a web API.

Getting Started

Step 1

Install #Do into your project using NPM.

npm install hashdo-web --save

Step 2

Require it in your code.

var hdweb = require('hashdo-web');

Step 3

Setup any plugins you may want to use

// Use MongoDB instead of default in-memory development database.
hdweb.hashdo.db = require('hashdo-db-mongo');

Step 4

Initialise the web server.

var baseUrl = 'https://myawesomesite.com';
var firebaseUrl = 'https://myawesomesite.firebaseio.com';
var port = 8080;
var cardsDir = './node_modules';

hdweb.init(baseUrl, firebaseUrl, port, cardsDir);

Step 5

Setup your own routes and/or middleware.

hdweb.express.get('/', function (req, res) {
  res.redirect('http://myawesomesite.com');
});

Step 6

Start the web server.

hdweb.start(function () {
  console.log('#Do web server is ready to go!');
});

Routes

The following routes are created to access #Do functionality through HTTP calls.

API

GET /api/count

Retrieve the number of cards that have been loaded in JSON format.

GET /api/cards?q=&page=

Retrieve the details for cards that have been loaded in JSON format. Parameter q can be used to provide a filter for card names. Parameter page will return the list of card on the requested page number. A maximum of 20 cards will be displayed per page.

GET /api/card?pack=&card=

Retrieve the details for a specific card. Parameter pack refers to the pack name the card belongs to. Parameter card is the card name.

POST /api/card/state/save

Allows saving card state directly from the client. This is called from client code using card.state.save which is available when clientStateSupport is enabled for your card.

POST /api/card/analytics

Allows sending analytics data directly from the client. This is called from client code using card.analytics.record which is available when clientAnalyticsSupport is enabled for your card.

Web Hook

POST /webhook/:pack/:card

Can be called to update a card's state from an external system. The body data must be JSON and will be passed into your card's webHook function for processing.

Cards

POST /:pack/:card

Secures any body data (secure card inputs) and responds with a token that can be used to decrypt that data. The body data must be JSON and will typically be any card inputs that need to be protected.

GET /:pack/:card

Gets card HTML (including inline JavaScript and CSS) for a specific card. URL query parameters are used for card inputs. token can be used to pass in any secured inputs.

License

Copyright 2015 (c). All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.