To complete this task, wrote a single function in the file src/shorten.js
. The file includes documentation on the requirements.
Do not modify package.json
or introduce additional modules. Only the Node standard library should be used to complete this task.
Also included a small test suite to check whether the code you've written works as expected.
To execute all tests, use the tests script:
$ npm run test