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

@washingtonpost/wp-uspapi

v6.0.3

Published

The supporting on-page functionality for The Washington Post's compliance process with CCPA, CDPA and a few other privacy tools

Downloads

181

Maintainers

luke.connorsluke.connorswrneffwrneffmcdohmcdohfloresafloresalavanderoilavanderoitaliatrackimtaliatrackimtomkaz-wapotomkaz-wapoaggyjleeaggyjleeemmakumeremmakumervonoehsenevonoehseneani512ani512lennybronnerlennybronnerln-washpostln-washpostjorgemhc-devjorgemhc-devbitsoglassbitsoglassit_procurementit_procurementsabrinamochisabrinamochiseanwaposeanwapolorenzoglorenzogjchaskelljchaskelldavidchaiwapodavidchaiwapoagillespieagillespiemartinezymartinezytam.stephtam.stephcolemanc4colemanc4luciovillaluciovilladucroquetducroquetthreeteaspoonsthreeteaspoonsmaddoxnelsonmaddoxnelsonstephanie.clarkstephanie.clarkjasonvuongjasonvuongjkoo87jkoo87kankelcrkankelcrgregoryauld2014gregoryauld2014uncompileduncompiledjbrown4jbrown4scarothersscarotherskhan.salauddinkhan.salauddinrowhawnrowhawnsubs-npm-buildersubs-npm-buildernealhumphreywaponealhumphreywapoashlynstillashlynstillptnielsenptnielsenleslie-sleslie-scourtney-kancourtney-kankevin.schaulkevin.schauljakecrumpjakecrumpmacallahmacallahjmuyskensjmuyskensmadisonwallsmadisonwallsdsantamarinadsantamarinaartmsilvaartmsilvaashtolashtolsberhanusberhanujjalcantarajjalcantaraalyssa.fowersalyssa.fowersjoemfoxjoemfoxreubenfbreubenfbcalcantaracalcantaraadrianblancoadrianblancochiquiestebanchiquiestebaniuraizeeiuraizeebdgrossbdgrossulmonicaulmonicabmferrillbmferrilldankeatingdankeatingtimmekotimmekokevinuhrmacherkevinuhrmachershellytanshellytanharrystevensharrystevenschrisrukanchrisrukanallisonnmannallisonnmannaaronsteckelbergaaronsteckelbergcarsonologycarsonologyshruthagandlashruthagandlabrafordabrafordafernandowzfernandowzadityajain15adityajain15linorabolinilinorabolinianthonyjpesceanthonyjpesce1313davidlee1313davidleekate.rabinowitzkate.rabinowitzfontcfontccecepascualcecepascualyuyanleiyuyanleivsingarayarvsingarayararamzsaramzsruxkruxknader_heidarinader_heidarithompsond3thompsond3tylerremmeltylerremmeltmac0201tmac0201mahigmahigjoemoore-postjoemoore-postealvarez79ealvarez79hdormidohdormidosgpottssgpottsyutaochenyutaochennwalker_wpnwalker_wpapbestapbestbriannaschroerbriannaschroershikha-subshikha-subnaemanaemachloemeisterchloemeisterjulia.ledurjulia.ledursolomonsscottsolomonsscottbetchavarriabetchavarriaeewrighteewrightcourthcourthnickkirkpatricknickkirkpatricktrann_wapotrann_wapodbnappdbnapptobefrankhjtobefrankhjessiekimessiekimsergio.pecanhasergio.pecanhameganwaltermeganwalteralyssabartuchalyssabartuchalexisbarnesalexisbarneskarenwangkarenwangdmoriarty6dmoriarty6mokhtar.alimokhtar.alidpham5dpham5klimenkovdklimenkovddavisshaverdavisshaverwelchkwelchkasamireissaasamireissakastningjkastningjpranavganorepranavganoreterrywpterrywphermionewyhermionewyamiemunozamiemunozsheamus-heisheamus-heinick.mourtoupalasnick.mourtoupalasshrddhawashpostshrddhawashpostwp-abergwp-abergmarcnahedmarcnahedandrevincandrevincdreyvitserdreyvitserval-l-hoslerval-l-hoslerstevefuenteswpstevefuenteswpadamsrobwadamsrobwjesse.post.washpojesse.post.washporamyalamatiramyalamatiebgrangerebgrangerbroadwaternebroadwaternerekha26rekha26jacknugent27jacknugent27ksemanur8ksemanur8danacasidydanacasidyhaysstephaniehaysstephaniebenjakibenjakiarturgalochaarturgalochajamelhendricksjamelhendrickskat-alokat-alomjperalesmjperalesjtotoolejtotoolejakekarajakekarajon.rosadojon.rosadoarnolda-wparnolda-wpchelseaconradchelseaconradmvoneshmvoneshvithalanisvithalanistimborisenkotimborisenkolukaskeelwapolukaskeelwapojanicekchenjanicekchensadbumblebeesadbumblebeetriticotriticohelmschelmscatomictangerineatomictangerinelmelgarlmelgarjuniorh28juniorh28mariaalconadabrooksmariaalconadabrookskatty-huertaskatty-huertaskrbrookskrbrooksnatalievinebergnatalievinebergaadittambeaadittambenauticaharvinnauticaharvintuckabelletuckabelleemily.engemily.enghaileyhaymondhaileyhaymondlpadillac4slpadillac4sgengelgengelcrunchwrap78crunchwrap78talpert022talpert022stericsonstericsonharmanwapoharmanwaposotojlsotojljosevazqueznpmjosevazqueznpmkt-prrykt-prryavalbuenaavalbuenanicrocsnicrocsniko_komniko_komtab00tab00marcostarafwashpostmarcostarafwashpostjosephjamesjosephjamesdgreen19dgreen19carlyncarlynalvaror2walvaror2wkarklislkarklislclau8aclau8ajmiguelfloresgjmiguelfloresgvladimirjvvladimirjvtawaddytawaddyalvarovalinoalvarovalinoalefkowalefkowysmildeysmildenetolm-wpnetolm-wpallidinatallidinatmark-a-wapomark-a-wapoflaviopsantannawapoflaviopsantannawapojondavenportwapojondavenportwapomichaeldominemichaeldomineashendrukashendrukgiomarwizegiomarwizedev-javudev-javucatherine1234catherine1234vviswavviswacashackcashackdnparmardnparmargregmanifoldgregmanifoldhannah.goodhannah.goodmalocuevimalocuevilmnalandlmnalandericlauericlaumballenwp1mballenwp1chen-joshchen-joshjoshhoegenjoshhoegenhrechthrechtdiegodisantdiegodisantmoodypmoodypfransandifransandinikki.brimmernikki.brimmerdwuandjunedwuandjunezhoyoyozhoyoyoelenalaceyelenalaceydkaodkaostevethedevstevethedevbenjamin.djangbenjamin.djangamayaverdeamayaverdelindojlindoj

Keywords

Readme

USPAPI

Need to use this for another project? It's a NPM package!

https://www.npmjs.com/package/@washingtonpost/wp-uspapi

Getting started

npm install

Run unit tests: npm run test

Production build: npm run build

Validating it works in a browser:

__uspapi('getUSPData', 1, (uspData, success) => {
    if (success) { console.debug(uspData, success) }
    else { console.error('no') }
});

What is this?

This provides window.__uspapi which is needed by ad systems, third party trackers, and any operation that touches user data for CCPA for California residents and CDPA for Virginia residents.

The US Privacy API is our control mechanism for allowing users to opt out of tracking under the California CCPA and Virginia CDPA regulations. Users are eligible for use of the US Privacy API and the Do Not Sell mode if they are California or Virginia residents (as determined by their billing address) or have a California or Virginia geolocation.

Because the California law is strong and protects users outside of the CA Geo, we also use it to grant EU users the ability to opt-out of tracking under the promise we make them when they encounter our TCF banner in the EU and European Economic Area. We call this “EEA Ad Consent” mode, or “EAC”.

Finally, CA and VA residents are also eligible to use the Global Privacy Control. Normally users who wish to opt out do so using the Do Not Sell link in our footer (only available to VA & CA-residents or Geo). However, they can also do so using a signal at the browser level. GPC is that signal and can be activated in Chrome or Edge using a plugin or using a custom configuration for Firefox.

This package is intended to be a one stop shop for implementing the API which, to resolve race conditions, may need to be implimented more than once on the page. It is set up in order to support that approach.

Unit tests cover the functionality of this package under CA, VA and EAC settings.

Using this package

Including this package in your library will not automatically activate the USP API. You have to initiate it like so:

try {
	new Uspapi({
		log() {},
		debug: console.debug,
	});
} catch (e) {
	console.error('USP API attachment may have failed.');
}

Initiating Arguments

This class takes an object that emulates the structure of console. You can pass console directly in on browser-facing software. You can also use this structure to pass in your own logging objects or NOOP functions. The USPAPI library makes use of log for verbose console logging to understand program flow. It makes use of debug to message the console about errors and issues that might disrupt its proper functioning.

The Window Object

On class initiation the USP API library will attach itself to the window object along with any necessary other objects. You do not need to attach it to the window object yourself.

How to test

Use The Washington Post Confluence pages under Washington Post Data Privacy > Technical Guidance to find and leverage testing instructions.

Release Process

Make sure you are up to date

git pull git status npm ci npm test

Prepare the Release

npm run build

Update version numbers

Either use npm version or manually update the version in package.json & package-lock.json.

git tag 2.0.0

Publish

npm publish git push git push --tags

Changelog

6.x

With version 6 we move away from parsing a geo cookie directly and move to using an on-page Privacy API. That is now an unlisted dependency for implementation.