Node.js module to expose Apolitical's common helper functions
How do I get set up?
Requires the following to run:
git clone email@example.com:apolitical/modules/common-helpers.git
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
yarn global add yalc- this is a global install on your computer
- In common-helpers, run
- In the repo you want to link to, run
yalc link @apolitical/common-helpers
- Each time you make a change in Common Helpers, you can run
yalc pushin common-helpers repo and these changes should reflect in the linked repo. If changes do not show up, try
yalc publish --push
.gitignorefile 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
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.