String-Manager: NPM Dependency to manipulate strings

in #utopian-io7 years ago (edited)

string manager on NPM

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 string

    example :

    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 query

    example :

    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 object

    example :

    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 :
    import {stripTags} from 'string-manager'
    let str = stripTags('<p>masak sepatu</p>')
    
    will be 'makan sepatu'
toSingleSpace
  • toSingleSpace(str), replace multiple spaces to single space
    example :
    import {toSingleSpace} from 'string-manager'
    let str = toSingleSpace(' perubahan   kaki   panas ')
    
    
    will be '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.
    import {toSlug} from 'string-manager'
    const slug = 'iam ready (for everything) to start'
    
    will be 'iam-ready-for-everything-to-start'
Currency
  • currencyFormat(int, str), set dot after three digit for currency nominal.
    import { currencyFormat } from 'string-manager
    const price = currencyFormat(245000, 'Rp')
    
    will be 'Rp 245.000'

Links



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

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

"Commits must not be older than 14 days."

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:

#### Updating
- How can users update the app/library? Changes are backward compatible or not? Do users need to run any type of migration scripts?

### New Features
- What feature(s) did you add?
Describe briefly and add screenshots/recordings if applicable.
- How did you implement it/them?
Link to relevant lines in the code on GitHub and explain briefly what you added/changed.

Thank you for the understanding. Have a nice day. :)