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

@apolitical/common-helpers

v0.10.1-beta.2

Published

Node.js module to expose Apolitical's common helper functions

Downloads

142

Readme

Common Helpers

Node.js module to expose Apolitical's common helper functions

How do I get set up?

Requirements

Requires the following to run:

Initial setup

Clone repository:

git clone [email protected]:apolitical/modules/common-helpers.git

Install dependencies:

yarn install

Run tests:

yarn test

Linking with yalc

This creates a symbolic link (symlink) that allows you to use your changes locally in other repos, rather than having to publish to npm to test

Yalc documentation

  1. Run yarn global add yalc - this is a global install on your computer
  2. In common-helpers, run yalc publish
  3. In the repo you want to link to, run yalc link @apolitical/common-helpers
  4. Each time you make a change in Common Helpers, you can run yalc push in common-helpers repo and these changes should reflect in the linked repo. If changes do not show up, try yalc publish --push
  5. Add .yalc/ and yalc.lock to your .gitignore file if it is not already there. This is just for local development, we don't want to commit yalc files.

If you are not seeing your changes come through in the repo you want to link, try running yalc add @apolitical/common-helpers. Note, this will change the package.json file to point at the yalc version of this package and you'll have to undo this before committing.

** Note **

When you're done, you can run a regular yarn install @apolitical/common-helpers in the linked repo to overwrite the yalc version, or run yalc remove @apolitical/common-helpers in the linked repo.

Double check that the package in your linked repo's package.json is pointing to @apolitical/common-helpers. yalc link should not touch the package.json, but it's wise to double check.

Some information about imageResizing helper function

  • This function takes two argument: filepath, desiredSize. The desiredSize value must be one of the following: 310x495, 240x366, 456x320, 60x60, 100x100, 310x155, 200x150, 425x425, 310x350, 650x280, 310x220.