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 🙏

© 2026 – Pkg Stats / Ryan Hefner

brylters

v0.5.0

Published

The Brython filters for JavaScript frameworks

Readme

Brylters

The Brython filters for JavaScript frameworks.

Django and Jinja give a template its filters: |date, |timesince, |slugify, |striptags, |urlencode, |tojson. Brylters gives them to a JavaScript framework whose templates hold Python values, the values of Brython, read through Bryntime.

Install it from npm:

npm install brylters
import { host, helpers } from 'brylters';

host.str = templateText; // the text your templates show of a value
const { date, slugify } = helpers; // each called by position or by name

The filters

| Filter | What it writes | |---|---| | date(value, style=None, clock=None, locale=None) | a date in the reader's language, as Django's \|date: style and clock are "full", "long", "medium" or "short", and a day written alone, "2026-08-24", is that day wherever it is read | | from_now(value, locale=None) | "3 days ago" or "in 2 hours", as Django's \|timesince and \|timeuntil, kept right as time passes | | slugify(text) | a title made into a URL segment, lowercased, every letter kept, accents included, and the rest a dash: héllo-wörld, where Django's \|slugify drops accents and punctuation | | strip_tags(html) | HTML shown as text, as Django's strip_tags, but parsed by the browser rather than pattern-matched, a script's source dropped | | urlencode(value) | a value, a mapping or a list of pairs, encoded into a URL, / included | | to_json(value, indent=None) | Jinja's \|tojson by JavaScript's own JSON.stringify, an int's digits and a float's .0 kept | | from_json(text) | the way back, an int past 2^53 with its digits |

Each is a plain function, exported under its name, and helpers holds them again, called by position or by name as a Python call is, refused as CPython refuses a wrong one.

What the framework decides

  • The text of a value, which slugify, strip_tags and urlencode start from and a refusal shows: host.str, Python's str() alone. A framework whose templates show None as nothing hands its own, so that slugify(None) is empty, as {x} is.
  • When a relative time is read again: from_now asks the subscription the framework hands Bryntime (host.subscriber) to wake it when its text changes. Alone, nothing wakes it, as in Django, where a page is finished once rendered.

License

Brylters is licensed under the BSD 3-Clause License, the same license as Brython.