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

responder

v0.1.6

Published

Responsive/Adaptive utilities for your Node.js application

Downloads

25

Readme

responder

DISCLAIMER: In very early development! Do not use ... contribute.

Responsive/Adaptive utilities for your Node.js Application The library provides the following:

  • API wrapper for working with Device Description Repositories such as:

    • WURFL (Local and WURFL Cloud Client)
    • openDDR (W3C DDR Core Vocabulary)
    • 51degrees.mobi Lite
    • Device Atlas
    • ApacheMap
  • Redis Data cache and simple Data API

  • Device Profile Mappings to Jade templates

  • Profile-specific Jade mixins

  • Intelligent UX via WebSockets and Modernizr (SPA application support)

Getting Started

Server

Install the module with: npm install responder


var responder = require('responder');

responder.profile(); // "smartPhone"

responder.product('brand_name'); // "Nokia"
responder.product('has_qwerty_keyboard'); // "false"
responder.product('mobile_browser'); // "Opera"

responder.html_ui('html_preferred_dtd') // "html5" 

responder.pdf('pdf_support'); // "true"

Client

Clone the responderjs-client.js into your app's JavaScript directory.

$ cd <public/js directory of your app> $ git clone git://github.com/jessecravens/responderjs-client.git

Add a script reference in your application pages. Most likely, your highest-level template.

HTML

<script src="js/responderjs-client.js"></script>

Jade

script(src='js/responderjs-client.js')

Documentation

The majority of web traffic through the traditional desktop web is divided among a manageable number of modern web browsers, most notably Google Chrome, Internet Explorer, Mozilla Firefox, Safari, and Opera. These browsers rely on HTML as its markup language, CSS for styling, and JavaScript for client-side scripting. Although cross-browser compliance continues to cause developer pain, it can generallly be expected that the content of most web applications will be visible to most users using modern web browsers. Futhermore, software updates for desktop browsers are frequent and widely distributed.

Unlike the desktop web, there is a significant amount of fragmentation on the mobile web. Markup can be WML, HTML, HDML, XHTML, or Mobile Profile. In addition, unlike the desktop web, a mobile web browser will vary on screen size, ability to support client side scripting, ability to support various image formats, and even color. Because the markup is generally sent directly to the phone, there is no opportunity for a central server to “fix” or adapt to browser limitations or defects. Furthermore, software updates for mobile browsers are rare.

ResponderJS helps bridge this gap with a simple to use API.

Device Description Repositories

  • WURFL (Local and WURFL Cloud Client)
  • openDDR (W3C DDR Core Vocabulary)
  • 51degrees.mobi Lite
  • Device Atlas
  • ApacheMap

W3C DDR Core Vocabulary

http://www.w3.org/TR/ddr-core-vocabulary/

Device Testing

MITE Device Anywhere: http://mite.keynote.com/download.php

WURFL Cloud

http://www.scientiamobile.com/wurflCloud/gettingStarted/

API

Properties

  • responder.isSmartPhone {Bool}
  • responder.isTablet {Bool}
  • responder.isDesktop {Bool}
  • responder.isLargeScreen {Bool}

Methods

  • responder.profile();
    • @return {String} current profile.
  • responder.is(profile)
    • @param {String} profile. Currently supports smartPhone, tablet,desktop and largeScreen.
    • @return {Bool} Returns boolean of current device matching argument you specify.
  • responder.test(ua)
    • @param {String} ua. User-agent string to test. @return {String} Returns string of profile that it matches.

Examples

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

(Nothing yet)

License

Copyright (c) 2012 Jesse Cravens
Licensed under the MIT license.