String-Manager: NPM Dependency to manipulate strings
Component
String-Manager is NPM dependencies to manipulate strings. there are several submodules that can be found here that deal with string manipulation.
Benefits
There are many examples of string manipulation among developers, whether it's for styling purposes or for generating arguments that other functions will be used. String-Manager has wrapped all the above needs into a set of dependencies that are easy to use and develop.
Installation
npm install string-manager
And then please import the module you want to use as needed. for the module available, please check the list below.
Become Contributor
I am very happy if anyone wants to join this project. you can join as a developer or to present bug-issue issues, feature requests.
If you find a bug or request a new feature, please create an issue via the following link string manager issues.
If you want to join as developer, please fork repo that is linked below, You can act as developer, user or tester. To make it easy to manage, be sure to make an issue first before working on the feature, and be sure to mention the issue when pulling the request.
If you want to work on the issue, please provide comments in advance, so as not done by other developers, thus avoiding conflict codes.
Available Modules
toCamelCase
toCamelCase(str)
, generate camel case style for any stringexample :
import {toCamelCase} from 'string-manager' console.log(toCamelCase('my name is yusuf'))
will be : 'My Name Is Yusuf'
objToQuery
objToQuery(obj)
, convert object to http queryexample :
import {objToQuery} from 'string-manager' let data = { is_active: false, count: 2, page: 1 } console.log(objToQuery(data))
will be : 'is_active=false&count=2&page=1'
queryToObj
queryToObj(str)
, convert http query to objectexample :
import {queryToObj} from 'string-manager' let query = is_active=false&count=2&page=1 console.log(queryToObj(query))
will be :
{ is_active: false, count: 2, page: 1 }
stripTags
stripTags(str)
, remove html tags
example :
will be 'makan sepatu'import {stripTags} from 'string-manager' let str = stripTags('<p>masak sepatu</p>')
toSingleSpace
toSingleSpace(str)
, replace multiple spaces to single space
example :
will be 'perubahan kaki panas'import {toSingleSpace} from 'string-manager' let str = toSingleSpace(' perubahan kaki panas ')
truncate
truncate(str, int, str)
, smart truncate string without losing meaning, with extra suffix.
example :import {truncate} from 'string-manager' const str = truncate('memasak mi ayam hujan-hujan seperti ini memang enak, apalagi ada tambahan segelas teh hangat, makin ok', 25, '...')
will be 'memasak mi ayam hujan-hujan...'
standart js substring, will be 'memasak mi ayam hujan-huj'
toSlug
toSLug(str)
, slug generator, replace space to single dash and remove unsupport characters for url.
will be 'iam-ready-for-everything-to-start'import {toSlug} from 'string-manager' const slug = 'iam ready (for everything) to start'
Currency
currencyFormat(int, str)
, set dot after three digit for currency nominal.
will be 'Rp 245.000'import { currencyFormat } from 'string-manager const price = currencyFormat(245000, 'Rp')
Links
- Github https://github.com/yussan/npm-string-manager
- NPM https://www.npmjs.com/package/string-manager
- Test on the web https://npm.runkit.com/string-manager
Posted on Utopian.io - Rewarding Open Source Contributors
Hello,
Thanks for the great library - looking good!
However, we cannot approve this contribution at this time. We have a rule for own projects on rules
Most of the commit history consist of commits earlier than 14 days.
I know, you have pushed a new feature yesterday, however, this is a small change and the way you have presented your contribution doesn't focus on the update but the project as a whole.
I am pretty sure you have no bad intentions, however, if we accept that that will open a door for abusers that they will revive and push small updates to old projects and try to farm Utopian.
Thank you.
You can contact us on Discord.
[utopian-moderator]
thanks. I get the conclusion, if it is not a new project, it should post when push a big feature
Definition of "big" is a complicated topic. You don't need to wait for 1000 lines to push an update. if you feel like you have reached a good milestone or you have solved a challenging problem, we're okay to reward it.
However, if you present the new features, we expect to see these information are focused in the contribution:
Thank you for the understanding. Have a nice day. :)