@allmysons/shortner
v2.2.0
Published
All My Sons URL Shortner utility
Keywords
Readme
AMS Shortner
AMS Shortner is URL shortner utility used across All My Sons for shortening the link
How to use
Install the package
npm install @allmysons/shortner --saveReady to shorten the link in the code
import getShortUrl from '@allmysons/shortner';
import sendEmail from './some-email-lib';
const response = await getShortUrl('https://umakant.com');
if (response?.url) {
const link = response.url;
await sendEmail('[email protected]', `Please <a href="${link}">click here to join the group.`);
} else {
throw new Error(response.message);
}Notes
This is ESM only build
For CJS use version 1.0.2 which is at https://www.npmjs.com/package/ams-shortner
How to build & publish
Fork a branch from master:
feature/<feature/change-name>Once you are done writing code, increment version in package.json
Commit your changes
Post it build the package using
npm run buildIf you need to validate, execute
npm linkin this package andnpm link ams-shortnerin testing repo.Once validation is done un link using
npm unlink ams-shortnerin testing repo.Raise a PR to merge in master
Once PR is approved then login
npm loginand then npmnpm publishGo to gihthub, create a tag with release notes
