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

justwords-node

v1.1.3

Published

just words Node SDK for server-side copy optimization.

Downloads

631

Readme

Just Words Node SDK

Typescript library for Just Words (YC W24).

Get Started

Installation

npm install justwords-node

Initialize

import {JustWords} from "justwords-node";

// Initialize client
await JustWords.initialize({apiKey, orgId});

// Get copy variant for a template
const copy = JustWords.getCopy("<template-id>");

// Get copy variant for a template, filtered by language (depends on how the metrics are set up)
const copyJa = JustWords.getCopy("<template-id>", { criteria: { language: "ja" } });

// Print copy ID
console.log(copy.id);        // "<copy-id>"

// Print copy variable
console.log(copy.vars.text); // "just setting up my copy"

Tips:

  • The initialize function must be awaited before calling JustWords.getCopy. JustWords.getCopy will throw if it has not been initialized first.
  • JustWords.getCopy will throw if the template ID is not known. A template must be created in advance before fetching any copy variants.

Changelog

1.1.2 (2024-06-11)

  • Updated prefetchData to return the data directly and updated the types to be used in other libraries
  • Removed 'stats' param from 'Copy' definition. Should be unused.

1.1.0 (2024-05-31)

  • Rewrote the pipeline to be more modular
  • Added "epsilon sampling" so that some percentage of copy are randomly shown

1.0.11 (2024-05-02)

  • Added jitter to the polling function and increased default polling period from 1 min to 10 min.

1.0.10 (2024-04-30)

  • Removed lingering console.log

1.0.9 (2024-04-30)

  • Can set host as an initialization param. Preparing for on-prem use-cases.

1.0.8

  • New changelog!

1.0.7 (2024-04-17)

  • Fixed issue where API key was being passed as an Authorization header and not as an 'X-Api-Key' header.