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

prescribe

v1.1.3

Published

Tiny, forgiving HTML parser

Downloads

75,168

Readme

Overview

Version License Build Status Code Climate Coverage Dependencies Commitizen friendly semantic-release Gitter

Tiny, forgiving HTML parser in JavaScript. This module started life as code from John Resig and has evolved and morphed over the years of hardening and use in Krux's postscribe library. This library doesn't aim for the greatest level of compliance, but rather to be as forgiving of real-life code encountered in scenarios like ad serving.

Installation

Browser

If you just want to use the script without installing anything:

<script src="dist/prescribe.min.js"></script>

NPM

You can include prescribe using npm:

npm install --save prescribe

This script runs in browsers, so this assumes you're using a module bundler like webpack, Browserify, JSPM or Rollup to consume CommonJS modules.

Accessing

ES6/ES2015

import HtmlParser from 'prescribe';

AMD

define(['prescribe'], function(HtmlParser) {

});

CommonJS

var HtmlParser = require('prescribe');

Browser Compatibility

This module is meant to parse any HTML that you can throw at it and do something meaningful, and we've taken care to make sur that it works on every browser we can get our hands on. We expect it to work on every browser built after 2009. There are over 30 unit tests that run on every commit. Prescribe is thoroughly tested and known to work well in the following browsers:

  • Firefox 4+
  • Chrome 10+
  • Safari 5.0+
  • Opera 10.0+
  • Internet Explorer 8+
  • iPhone/iPad and other WebKit-based browsers

Note that we do not provide any support for Internet Explorer versions earlier than IE8.

Help/Bugs/Requests

We ♥ bug reports.

Have a problem? Need help? Would you like additional functionality added? We use GitHub's ticket system for keeping track of these requests.

Please check out the existing issues, and if you don't see that your problem is already being worked on, please file a new issue. The more information the better to describe your problem.

Contributing

We ♥ forks and pull requests.

Please see CONTRIBUTING.md for full details.

Environment

The project requires nodejs (>=5.6) and npm (>=3.6.0) for development. It has no runtime dependencies.

Developing

Check the code out and install the development dependencies using:

npm install

Building

To build the code, run

npm run build

Linting

We use ESLint and JSCS to do static analysis of the JavaScript and keep things smelling good. To run both, use:

npm run lint

Testing

Using travis-ci, the Mocha unit tests are run on every commit using PhantomJS to run the tests with a real browser.

To test the code locally, you can use:

npm test

To run tests in Test-Driven-Development mode, where the test will be run after every change, use:

npm run tdd

To run the cross-browser tests, use:

npm run test:cross-browser

Issue Guidelines

Please either add a failing unit test or include a jsfiddle that distills and reproduces the issue.

License

We aim for you to use this inside your application, so we picked the least restrictive license we could find: the MIT license.

See LICENSE.