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

web-docs-data

v0.0.16

Published

Structured web documentation.

Downloads

18

Readme

web-docs-data

Structured web documentation.

This package contains structured web documentation.

Usage

import webDocs from "web-docs-data-test" assert { type: "json" };
console.log(webDocs["css"]["properties"]["margin"]["summary"]);
The <strong><code>margin</code></strong> <a href="/en-US/docs/Web/CSS">CSS</a> shorthand property sets the <a href="/en-US/docs/Web/CSS/CSS_box_model/Introduction_to_the_CSS_box_model#margin_area">margin area</a> on all four sides of an element

Details

This package exports a single JSON object that contains web documentation in a structured format, suitable for embedding content in developer tools.

Currently it contains only CSS properties, accessible under the "properties" key of the "css" object:

{
  "css": {
    "properties": {
      ...
      "margin": {}
      ...
    }
  }
}

Each property object may contain:

  • "mdn-page": a string containing the URL of the MDN page for the property
  • "browser-compatibility": a string containing the BCD query for the property
  • "status": an array of strings, each representing a status flag. The strings can be any of the following:
    • "experimental"
    • "deprecated"
    • "non-standard"
  • "summary": a string containing the one- or two-sentence summary for the property, in HTML.
  • "interactive-example": a string containing the URL of an interactive example for the property
  • "syntax-example": a string containing a series of examples demonstrating the property's syntax
  • "constituent-properties": present only if this is a shorthand property. An array of objects, one for each property for which this property is a shorthand. Each object has two properties:
    • "text": the name of the property
    • "target": link to the property's page
  • "see-also": an array of objects, each representing a link to a related page. Each object has two properties:
    • "text": the link text
    • "target": the URL of the linked page
  • "formal-syntax": syntax for the property and all the types that participate in its definition. An object with the following properties:
    • propertySyntax: a string containing the syntax for the property
    • constituents: an object with one item for each type that participates in the definition of the property's syntax. Each item's key is the name of the type, and the item's value is a string containing the syntax for that type.

All these properties should be treated as optional. (though it would be nice to make better guarantees than this).

(it would be nice to add spec-url but that requires a dependency on BCD. but we should do it anyway)