Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blossom-babs/js-ord
An NPM package used for doing more with less code
https://github.com/blossom-babs/js-ord
ascii javascript npm npm-package npm-scripts npmjs
Last synced: 27 days ago
JSON representation
An NPM package used for doing more with less code
- Host: GitHub
- URL: https://github.com/blossom-babs/js-ord
- Owner: blossom-babs
- License: mit
- Created: 2022-04-15T13:47:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-07T12:15:03.000Z (over 2 years ago)
- Last Synced: 2024-10-10T05:38:53.272Z (30 days ago)
- Topics: ascii, javascript, npm, npm-package, npm-scripts, npmjs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/js-ord
- Size: 248 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# [js-ord](https://www.npmjs.com/package/js-ord)
![npm scoped](https://img.shields.io/npm/v/@blossombabs/ord)
Do more with less code
1. Convert ASCII values to alphanumeric characters
2. Convert alphanumeric characters to ASCII
3. Remove letters from **exact** position and return original string_Regular javascript_
```
// convert string to it's ASCII value
str = ((str.charCodeAt() - 'A'.charCodeAt()) + rotation) % 26// Get the alphanumeric value from ASCII
cipher.push(String.fromCharCode('A'.charChodeAt() + str))// check if a string is uppercase
return string === string.toUpperCase()// check if a string is lowercase
return string === string.toLowerCase()
```_Js-ord_
```
1. // convert string to it's ASCII value
str = ((ord(str) - ord('A')) + rotation) % 26---
2. // Get the alphanumeric value from ASCII
cipher.push(ordFrom(ord('A') + str))---
3. // check if a string is uppercase
return isUpper(string)---
4. // check if a string is lowercase
return isLower(string)---
5. // remove string from exact position
const newString = shrink('Google', 2)
console.log(newString) // return 0Enter the index of the letter you want to remove
Function accepts the following parameters:
1. the string you want to modify
2. the starting index
3. the ending index (if you do not specify, every element from the starting index will be removed)const aString = shrink('Bolossom', 2, 3)
console.log(aString) // Boom---
6. //converts string to its palindrome
const palindrome = isPalindrome('blossom')
console.log(palindrome) // 'mossolb'
```## Install
```
npm install js-ord
```## Usage
```
const
{ord, ordFrom,
isUpper, isLower,
shrink, isPalindrome} = require('js-ord')console.log(ord('a')) // 97
console.log(ordFrom(97)) // a
```# 🤝 Contributing
Contributions, issues and feature requests are welcome!
## Authors
🌸 **Blossom**
- Github: [@blossom-babs](https://github.com/blossom-babs/)
- LinkedIn: [Blossom Babalola](https://www.linkedin.com/in/blossom-babalola/)
- Twitter: [@BlossomBabalola](https://twitter.com/BlossomBabalola)### Show your support
- Give a ⭐ if you like this project