1.2.1 • Published 13 days ago

@libtommy2024/excepturi-itaque-minima-impedit v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
13 days ago

About The Package

There are lots of scenarios which one can use our Random string generator the most known or the best scenario is for

1.Password generation

2.Token generation.

3.Testing

4.id generation

This package generate random string based on the given parameters.

Getting Started

To start to use this on local machine build then first Test the program using the test.js

Install node modules

  • npm
npm install @libtommy2024/excepturi-itaque-minima-impedit
  • yarn
yarn add @libtommy2024/excepturi-itaque-minima-impedit

Usage

For generating a random string you call generate() function.By default it generate 16 character string.

const randomString = require('@libtommy2024/excepturi-itaque-minima-impedit');
randomString.generate(); // xabgtl3yb1Ac0MrQ

or you can use import statment

import randomString from '@libtommy2024/excepturi-itaque-minima-impedit';

If you want some length to random string pass a number to the function.

randomString.generate(6); // lAo3Bi

To be more specific you can pass an object for more flexibility.This are the listed options you can provide

type options = {
  charset?: 'alphanumeric' | 'number' | 'alphabet' | 'hex' | 'binary' | 'octal';
  lowerCaseOnly?: boolean; //only lowercase letter
  range?: string; // user provided charset
  length: number; //length of the character if not provided generates 16 characters by default
  upperCaseOnly?: boolean; // only uppercase letter
  insertSymbol?: boolean; // insert symbols to given charset
  symbolsOnly: boolean; //only symbols
  prefix: string; // add before string
  suffix: string; // add after the string
};

passing down the options

Generate string only in the given string range

randomeString.generate({
  range: 'abc123',
  length: 6,
});

// a3cb21

You can set also set type of string

randomString.generate({
  charset: 'number',
  length: 10,
}); //2342612198

randomString.generate({
  charset: 'alphabet',
  length: 10,
}); //SoWhopDFTb

randomString.generate({
  charset: 'hex',
  length: 6,
}); // C0faDB

You can insert prefix prefix or suffix characters. Note that the length of the prefix or suffix is not counted with the length of the random string.

randomString.generate({
  length: 10,
  prefix: 'pre-',
}); //pre-GaKdvH8Bro
randomString.generate({
  length: 10,
  suffix: '-suff',
}); //0YcCeMISpE-suff

You can also insert symbols if you pass set the insertSymbol option to true. But it doesn't work for binary or octal or hex charset option.

randomString.generate({
  insertSymbol: true,
});
//bd@MK8ˆIvpGVoorO{FJkf]iMz,{1+-8g

You can pass the option upperCaseOnly to make the string only capital and lowerCaseOnly to make the string lowercase

randomString.generate({
  charset: 'alphabet',
  upperCaseOnly: true,
});
//ODEISDGQXUGGOHHG
randomString.generate({
  lowerCaseOnly: true,
});
//fnzkamf0svos4yso

You can get symbols only if you set option symbolsOnly:true,

randomString.generate({
  symbolsOnly: true,
  length: 10,
});
// ?[]}$'&,{]

For fun you can also generate random emojis using generateUnicodeEmoji(length)

randomString.generateUnicodeEmoji(1); //🍍

Command Line Usage

First the package should be installed globally

$ npm install @libtommy2024/excepturi-itaque-minima-impedit -g

$ yarn add @libtommy2024/excepturi-itaque-minima-impedit

$ @libtommy2024/excepturi-itaque-minima-impedit

 // Urp0YDaIHWn7YCCF

$ @libtommy2024/excepturi-itaque-minima-impedit  upperCaseOnly=true charset=alphanumeric

 // DX5ACJP1FJN5Q79Z

$ @libtommy2024/excepturi-itaque-minima-impedit   charset=alphanumeric insertSymbol=true length=8
// S8Cza8v^

$ @libtommy2024/excepturi-itaque-minima-impedit  prefix=pre-
 //pre-KOyWstwcpA6sLaH3

$ @libtommy2024/excepturi-itaque-minima-impedit  generateUnicodeEmoji length=5

 // ⏺️💤👇😰🗳️

API

randomString

generate(option|length)

  • option:

  • length: define the length of the output default 16 Optional

  • insert Symbol: to use Symbols when generatig random string output Optional

  • charset:

  • capitalization:

    • upperCaseOnly : Only Capital Leters are used to generate the output Optional

    • lowerCaseOnly : Only Small Leters are used to generate the output Optional

  • symbols only:

    • used to generate symbols only
  • prefix:

    • Adds a character before the random string
  • suffix:

    • Adds character after the random string

generateUnicodeEmoji(length)

  • generates random emojis

Tests

  • npm install
  • npm run test

See the open issues for a full list of proposed features (and known issues).

support us

☕ Buy me a coffee

  • You can also give as star to our repo.

Authors

Author 1

👤 Dagmawi Zewdu

Author 2

👤 Sentayhu Berhanu

Contribution

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Built With

Contact

Dagmawi Zewdu - @Dagi - dagi.zewdu.dz@gmail.com

Sentayhu Berhanu- @Sentayhu - sentayhuberhanu19@gmail.com

Project Link: https://github.com/libtommy2024/excepturi-itaque-minima-impedit

ecmascriptES6jsdomcommandargparsetelephonewatchermkdirpbusyECMAScript 2020breakuuidauthenticationutilclitoArrayenvArray.prototype.containscharactercharactersregexppush[[Prototype]]symbolmochastylingjoiextrachannelES2019String.prototype.matchAlldeterministic_.extendMapYAMLomittypedarraysgradients css3trimLeftfunctionalrecursivewalkinges2018Object.keyspreprocessorloggerfullwidthFunction.prototype.namenodenodejslibphonenumberdragratelimitlaunchES2020negativekeyfixed-widthtaskcreatetostringtagfull-widthfastclonecrypthttpscore-jsreuselockfilecoremetadataeverypostcss-pluginwindowsredactgradients cssTypeScriptjsonschemavestnopeargsObservablepoint-freefunctionsthreetypedarrayforEachcircularformatcall-boundpropertiesES5waapirandomutilsES2021mobilelimitwordwrapInt32Arrayvarjavascriptindicatormkdirs6to5resolveclassnameES2018httpfindLastminimalurldatastructurethroatgetoptuser-streamscolourgraphqlspawnphonesignalsclassnamescolumnsSymbolPromiseshimquerytermtypesafebannerbddECMAScript 5css lessprocessxhrRegExp#flagsUint8Arrayes2015figletsidepropbufferTypeBox3dtranspilerfindLastIndexentriesapollofast-clonehooksterminalshebangutilitiestranspileESimmernamescollectionbootstrap lessspinnerexpressserializerhookformoptimizerflagslimitedconfigartcall-bindArray.prototype.includescallbindcollection.es6testsetterURLremovedayjsESnextcallstringiteratorfast-copyenderwritablesomeweaksetencryptionsyntaxutil.inspectautoprefixertrimStartformsinterruptsECMAScript 3Uint16Arrayefficientless cssstreams2rm -frless compilereslintdataArray.prototype.flatMappackage.jsonmatchAllECMAScript 2021validationansiECMAScript 2017asciicjkhascallboundlookshrinkwrapcurl$.extendshamvalidatorscheme-validationArray.prototype.flathardlinkstypesettingscurriedcodesreact animationreact-testing-librarytrimRightutilitylistenersstyled-componentszodhasOwnurlspackageformes8react posereal-timeequalcolorsincludespicomatchSymbol.toStringTageventEmitterextensionwgetmacosestreegetintrinsicequalityopenscommanderstablestatustypeerrormergewalkECMAScript 2015spinnersObject.getPrototypeOfdependenciesPushlrufind-upStreamsposeletbufferslastconsolehashwriteimmutablemonorepointrinsiciterateinputmime-dblogharmonywatchFilevalidtoobjectwatchingpostcssjsonpathless.jsarraystypescripthigher-orderxtermFloat64Arraydefineairbnbaccessibilitynamemiddlewarequerystringcacheawaitdebuggerframeworkinternal slotslotwordbreakcensorastdotenvdiff.envArray.prototype.findLasttddyamllinkfindsetImmediatechromiumexitexecextendtacitpipeES2023flattenUnderscorepatchprotolinewraprm -rfform-validationdom-testing-libraryescapeboundlanguagecommand-linepnpm9compile lessjsdiffconfigurablebindponyfilltypesjsxtc39errorformattingrmdirserializemake dirreducereventsCSSStyleDeclarationjapaneseconcatMaphelpersECMAScript 2016constdirdefaultTypedArraybyteOffsetArrayBuffer#sliceinternalcmdtesterpolyfillparsermimetypesIteratorArrayrobustlesscssregexpositiveopenemitviewObject.fromEntriesBigInt64ArrayWebSocketssortlintframergesturesmakejasmineidlelinux-0takeeast-asian-widthdataViewprotocol-bufferstoSortedarrayreadableinferencerfc4122widthES2016Rxbyte256styleseslint-pluginfindupkarmaURLSearchParamsbyteLengthbrowserlistbluebirdfileeslintconfigsymlinkcss variable@@toStringTagRFC-6455emojiregular expressionsspeedes-abstract__proto__flaglessfast-deep-copytyped arrayarktypetrimloggingdomenumerableInt8ArraymruString.prototype.trimwebsiteflatMapstarterReactiveExtensionsArrayBufferAsyncIteratortoolkitUint8ClampedArraypyyamlsameValueZerojson-schema-validatorlengthobjectelectronguidaccessortypedtrimEndides2017babelES2015HyBiobjjQueryexestreamssequenceInt16Arraydescriptorsbabel-coremaprmfunctionpuretouchrapidoffsetCSSdropupstructuredClonetypanionsetPrototypeOftestingless mixinsquoteflatqsconcurrencyyupwebjwtprotobufObjectpopmotionreactstylesheetdeepcopythrottlecolumncoercibleredux-toolkitpasswordjsnested cssparentpackage managerstyleguideObject.assignObject.valuesbootstrap cssclientpropertyasyncschemedirectorynegative zerodebugRegExp.prototype.flagsajaxjson-schemaArrayBuffer.prototype.slicees-shimsRxJSmulti-packageObject.isObservablescopykeyschilddeep-copyObject.entrieserror-handlingchailook-upirqinstallECMAScript 2022getPrototypeOfargvramda
@libtommy2024/dolores-quidem-iusto-repudiandae@libtommy2024/tenetur-ut-placeat-alias@libtommy2024/blanditiis-optio-culpa-nemo@libtommy2024/consectetur-aspernatur-illum-asperiores@libtommy2024/consequatur-corporis-quisquam-aliquid@libtommy2024/corporis-occaecati-tempore-magni@libtommy2024/corporis-ullam-velit-fuga@libtommy2024/corrupti-adipisci-non-optio@libtommy2024/corrupti-illum-doloremque-veritatis@libtommy2024/accusamus-dolorum-placeat-eum@libtommy2024/accusamus-tenetur-esse-illo@libtommy2024/accusantium-nam-eum-commodi@libtommy2024/ad-dolorem-nemo-blanditiis@libtommy2024/adipisci-eum-aut-vero@libtommy2024/alias-beatae-rerum-hic@libtommy2024/cum-veritatis-quos-doloribus@libtommy2024/cumque-ex-cum-enim@libtommy2024/cupiditate-amet-rerum-fugiat@libtommy2024/curly-octo-guacamole@libtommy2024/debitis-aut-qui-eveniet@libtommy2024/debitis-impedit-doloremque-magni@libtommy2024/deleniti-aut-velit-libero@libtommy2024/deleniti-provident-consectetur-maiores@libtommy2024/deleniti-repellat-soluta-nulla@libtommy2024/dignissimos-ipsam-amet-voluptate@libtommy2024/distinctio-voluptates-aliquam-necessitatibus@libtommy2024/dolore-corrupti-error-laudantium@libtommy2024/aliquam-veritatis-id-minima@libtommy2024/amet-reprehenderit-ipsa-cupiditate@libtommy2024/animi-enim-amet-aperiam@libtommy2024/animi-odio-rerum-temporibus@libtommy2024/corrupti-nesciunt-consequatur-optio@libtommy2024/corrupti-perferendis-aperiam-quo@libtommy2024/culpa-iusto-inventore-eum@libtommy2024/culpa-non-pariatur-et@libtommy2024/culpa-quod-accusamus-quae@libtommy2024/cum-tempora-accusantium-deleniti@libtommy2024/alias-ut-adipisci-vitae@libtommy2024/aliquam-totam-pariatur-debitis@libtommy2024/deserunt-accusantium-nihil-quod@libtommy2024/animi-recusandae-distinctio-minus@libtommy2024/architecto-eius-quos-error@libtommy2024/architecto-error-rem-sed@libtommy2024/asperiores-vel-pariatur-sed@libtommy2024/assumenda-natus-distinctio-reiciendis@libtommy2024/at-fuga-quibusdam-voluptatibus@libtommy2024/autem-quisquam-perferendis-molestias@libtommy2024/beatae-earum-sint-asperiores@libtommy2024/blanditiis-dolor-consectetur-pariatur@libtommy2024/id-veritatis-exercitationem-alias@libtommy2024/illo-fugit-iste-magnam@libtommy2024/impedit-fugiat-ratione-accusantium@libtommy2024/in-deleniti-molestiae-animi@libtommy2024/in-excepturi-sint-perspiciatis@libtommy2024/in-iste-nisi-at@libtommy2024/incidunt-iste-molestiae-recusandae@libtommy2024/inventore-necessitatibus-nulla-perspiciatis@libtommy2024/ipsum-placeat-corrupti-libero@libtommy2024/iste-harum-delectus-vel@libtommy2024/iure-nobis-veritatis-minus@libtommy2024/iusto-suscipit-fugit-recusandae@libtommy2024/labore-consequuntur-perferendis-facere@libtommy2024/labore-temporibus-tempora-est@libtommy2024/laboriosam-expedita-voluptatum-fugit@libtommy2024/laudantium-doloribus-adipisci-quod@libtommy2024/laudantium-neque-voluptate-omnis@libtommy2024/laudantium-optio-nihil-incidunt@libtommy2024/eum-suscipit-aperiam-optio@libtommy2024/expedita-accusamus-deserunt-esse@libtommy2024/expedita-voluptatum-harum-quo@libtommy2024/facere-est-quasi-repudiandae@libtommy2024/facere-optio-numquam-quibusdam@libtommy2024/facere-quis-velit-unde@libtommy2024/facilis-dolorem-doloribus-ab@libtommy2024/facilis-eos-ad-libero@libtommy2024/fuga-maxime-earum-nisi@libtommy2024/harum-quaerat-incidunt-aperiam@libtommy2024/id-natus-animi-modi@libtommy2024/id-suscipit-molestiae-similique@libtommy2024/libero-sed-eum-exercitationem@libtommy2024/magnam-ad-ad-eos@libtommy2024/magnam-magni-quia-est@libtommy2024/magni-asperiores-blanditiis-veniam@libtommy2024/magni-vel-recusandae-minus@libtommy2024/minima-ipsam-natus-dolor@libtommy2024/minus-ratione-accusantium-fuga@libtommy2024/modi-facere-nemo-quas@libtommy2024/dolore-culpa-quia-aut@libtommy2024/dolore-et-vel-voluptas@libtommy2024/dolore-praesentium-expedita-vitae@libtommy2024/dolore-velit-perspiciatis-nisi@libtommy2024/dolorem-cumque-ullam-earum@libtommy2024/dolorem-explicabo-itaque-atque@libtommy2024/dolorem-temporibus-error-repellendus@libtommy2024/doloremque-amet-accusantium-quis@libtommy2024/doloremque-error-commodi-accusantium@libtommy2024/doloremque-libero-eius-provident@libtommy2024/ducimus-nesciunt-doloremque-eligendi@libtommy2024/ea-nulla-architecto-dolores@libtommy2024/ea-rerum-hic-odio
1.2.0

13 days ago

1.2.1

13 days ago

1.0.0

1 month ago