![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
The nth package simply takes a number and returns the same number with the appropriate placing string. For example the number 1 becomes 1st, and the number 2 becomes 2nd.
The 'nth' package contains a dirt simple module that takes an integer and then appends the appropriate place suffix. For example:
Using the package is very easy. Just download it and install it via NPM:
npm install nth --save
Once the package is downloaded and installed, you just need to require in the module and call the appendSuffix
method:
var nth = require('nth');
var output = nth.appendSuffix(23);
console.log(output); // outputs: '23rd'
If you just want to get the suffix itself (without the number) then you can call the getSuffix
method.
var nth = require('nth');
var output = nth.getSuffix(23);
console.log(output); // outputs: 'rd'
If you find a bug feel free to submit a pull request.
Beyond the few obvious test cases I haven't spend any time on more complex scenarios like dealing with exponents. I can't imagine many folks really using this library in that context anyway :)
FAQs
The nth package simply takes a number and returns the same number with the appropriate placing string. For example the number 1 becomes 1st, and the number 2 becomes 2nd.
The npm package nth receives a total of 21 weekly downloads. As such, nth popularity was classified as not popular.
We found that nth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.