🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@apolitical/common-helpers

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apolitical/common-helpers

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

0.10.1-beta.2
latest
npm
Version published
Maintainers
1
Created
Source

Common Helpers

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

How do I get set up?

Requirements

Requires the following to run:

  • git
  • node.js 10.19.0+
  • yarn

Initial setup

Clone repository:

git clone git@gitlab.com: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

  • Run yarn global add yalc - this is a global install on your computer
  • In common-helpers, run yalc publish
  • 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 push in common-helpers repo and these changes should reflect in the linked repo. If changes do not show up, try yalc publish --push
  • 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.

Keywords

Helper Functions

FAQs

Package last updated on 25 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts