All My Sons URL Shortner utility
npm install @allmysons/shortnerAMS Shortner is URL shortner utility used across All My Sons for shortening the link
1. Install the package npm install @allmysons/shortner --save
2. Ready to shorten the link in the code
``js
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('demo@allmysons.com', Please click here to join the group.);`
} else {
throw new Error(response.message);
}
- This is ESM only build
- For CJS use version 1.0.2 which is at https://www.npmjs.com/package/ams-shortner
1. Fork a branch from master: feature/
2. Once you are done writing code, increment version in package.json
3. Commit your changes
4. Post it build the package using npm run build
5. If you need to validate, execute npm link in this package and npm link ams-shortner in testing repo.
6. Once validation is done un link using npm unlink ams-shortner in testing repo.
7. Raise a PR to merge in master
8. Once PR is approved then login npm login and then npm npm publish`
9. Go to gihthub, create a tag with release notes