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

v0.10.77

Published

Framework for creating stateful interaction cards that can be embedded in mobile applications or viewed in a browser.

Downloads

99

Readme

#Do

#Do is framework for creating static or stateful interaction based cards that can be embedded in mobile applications or viewed in a browser. This is the base library that can be used in your own projects to generate, embed or serve #Do cards.

If you are looking for a way to create cards, get your hands on the #Do CLI which contains templates to quickly generate packs and cards as well as a test harness to easily test your card functionality.

Card examples can be found here: https://github.com/UXFoundry/hashdo-cards

Getting Started

Step 1

Install #Do into your project using NPM.

npm install hashdo --save

Step 2

Require it in your code.

var hashdo = require('hashdo');

Step 3

Generate the HTML, CSS and script necessary to render your card.

hashdo.card.generateCard({
  url: 'http://hashdo.com/restaurants/nearby',
  directory: '/Where/Your/Cards/Are/Located',
  packName: 'restaurants',
  cardName: 'nearby',
  inputValues: {
    latitude: -29.837795,
    longitude: 30.922539
  }
},
// Callback containing an error or the HTML you can render.
function (err, html) {
  if (!err) {
    // Do something with the HTML.
    console.log(html);
  }
  else {
    console.error(err);    
  }
});

Check out our open source #Do cards to test things out with or use the #Do CLI to create your own.

API

Packs

The packs module is accessible through hashdo.packs. This modules contains information about the packs and cards available.

Cards

The card module is accessible through hashdo.card. This module is used to secure inputs, generated card HTML and also perform the logic necessary for a web hook call.

Environment Variables

CARD_SECRET

Provide a value for this if you want to properly secure the URL and query parameters of a card.

LOCK_KEY

Provide a value for this if you want to properly secure input data in the database when using 'secureInputs'.

BASE_URL

Required if making use of client state. This will be the URL that cards will make HTTP calls to.

FIREBASE_URL

Use Firebase to update card state on the client when it changes. Without this the card will need to be refreshed manually to update it's client data.

Plugins

Modules can be replaced by your own implementations if necessary. Good examples of this are the data store or the analytics provider you wish to use.

The following plugins are available. If you have created your own plugins, let us know and we'll add links here.

Database

By default #Do uses an in-memory database. Card states and locks are lost when the application unloads but this is actually great for development and testing purposes.

MongoDB Plugin - Use this database plugin to persist your data to a MongoDB database.

Analytics

By default #Do has no analytics implementation. When an event is triggered it will output the details to the console.

Keen IO Analytics Plugin - Use this analytics plugin to send events to Keen IO.

To use a plugin, simply replace the exposed property with a new implementation. Each plugin's documentation will describe the requirements and the process of replacing the functionality.

View Engine Support

Currently #Do supports the following view engines.

Any view engine that Consolidate supports can be added as well if necessary. Using a view engine is not a requirement, you are welcome to use regular HTML.

CSS Preprocessor Support

Currently #Do supports the following CSS preprocessors.

Using a preprocessor is not a requirement, you are welcome to use regular CSS.

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.