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

pronouns

v1.3.3

Published

personal pronoun helper

Downloads

15

Readme

pronouns.js

personal pronoun helper module. fork of pronoun.is.

pronouns.js aims to be an easy way to handle numerous personal pronouns in English. It remains open-ended to allow for myriad use cases. One possible application could be in a social media service in which users can add their pronoun(s) and the interface can refer to them properly.

Play the demo here.

Basic usage

npm i --save pronouns

const pronouns = require('pronouns');
const my = pronouns('they/them');

console.log(my.pronouns);
// ['they', 'them', 'their', 'theirs', 'themself']

console.log(my.subject);
// 'they'

console.log(pronouns.table);
// [
//   ["she", "her", "her", "hers", "herself"],
//   ["he", "him", "his", "his", "himself"],
//   ["they", "them", "their", "theirs", "themself"],
//   ["ze", "hir", "hir", "hirs", "hirself"],
//   ["ze", "zir", "zir", "zirs", "zirself"],
//   ["xey", "xem", "xyr", "xyrs", "xemself"],
//   ...
// ]

The database

The pronouns "database" is an array of arrays meant to represent a table, located in resources/pronouns.json, with fields and example values as follows:

subject|object|possessive-determiner|possessive-pronoun|reflexive -------|------|---------------------|------------------|--------- they | them | their | theirs | themself

The code

util.js has most of what was translated from the original Clojure code. These functions are mostly meant for accessing rows in a table or formatting strings and is not needed for typical users, but is exposed nonetheless as pronouns.util.

index.js is the main program. pronouns is both a function you can call with a string parameter, and an object with references to the table and a few methods.

All of the following are valid inputs to the pronouns function:

  • she
  • he/him
  • ze/hir or they/.../themselves
  • she/her, they/them, it/its, or sie/hir

Tests

The test/ directory contains unit tests for index.js and util.js. Please run the tests and confirm that everything passes before merging changes, and please include tests with any new logic you introduce in a PR!

Contributing

Issues and pull/merge requests regarding the code are very much welcome! If you would like to request pronouns to be added to the table there is an issue template for doing so. You should also consider doing the same with the original repository.

To do

  • ~~Autocomplete!~~
  • ~~Interactive demos and examples~~
  • Parse even shorter multi-pronoun inputs like "they/she" or "she/him"
  • Handle "any/all", unknown, or badly formatted inputs better
    • Should default to they/them
  • Allow modifying an existing object (how would that work?)
  • More comprehensive documentation