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

@nymag/cuneiform-cmpt

v1.0.3

Published

A wrapper for the save and render functions of a Cuneiform component. This is used for a set of NyMag components that display data from the `published-articles` index and which have **content descriptors**, which are properties that editors use to define

Downloads

150

Readme

cuneiform-cmpt

A wrapper for the save and render functions of a Cuneiform component. This is used for a set of NyMag components that display data from the published-articles index and which have content descriptors, which are properties that editors use to define what articles should populate them.

The save function automaticallys sets cuneiformQuery, cuneiformPinned, and cuneiformScopes based on the component's content descriptors.

The render function simply converts array content descriptors to and from a format compatible with Kiln.

Usage

You can simply invoke either of these functions in the equivalent functions of the component that is using them:

module.exports.save = (ref, data, locals) => {
    cuneiformCmpt.save(ref, data, locals);
    // ...
    return data;
}
module.exports.render = (ref, data, locals) => {
    cuneiformCmpt.render(ref, data, locals);
    // ...
    return data;
});

Content Descriptor Glossary

  • overrideUrl - Force the article at the specified URL into the slot, regardless of the other content descriptors. (Sets cuneiformPinned).
  • dedupeContexts - Prevents the same article from being duplicated between two or more cuneiform components. See below. (Sets cuneiformScopes).
  • botIgnore - If set, the microservice will ignore this component entirely. (Sets cuneiformIgnore).

The following content descriptors are joined by OR relationships:

  • siteSlugs - Match articles belonging to a site with ANY of these site slugs.
  • sitePrefixes - Match articles with ANY of these URL prefixes (expects protocol and port).
  • crossposts - Match articles crossposted to ANY of these sites, expressed via slug (e.g. thecut).

The following content descriptors are joined by AND relationships:

  • includeFeatureTypes - Match articles with ANY of these feature types.
  • excludeFeatureTypes - Exclude articles with ANY of these feature types.
  • includeTags - Match articles with ANY of these tags.
  • excludeTags - Exclude articles with ANY of these tags.
  • includeContentChannels - Match articles with ANY of these content channels.
  • includeStoryCharacteristics - Match articles with ALL of these story characteristics.
  • excludeStoryCharacteristics - Exclude articles with ANY of these story characteristics.
  • includeFeeds - Include articles set to appear in ALL of these feeds.
  • excludeFeeds - Exclude articles set to appear in ANY of these feeds.