File tree Expand file tree Collapse file tree 3 files changed +34
-29
lines changed Expand file tree Collapse file tree 3 files changed +34
-29
lines changed Original file line number Diff line number Diff line change 1
1
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
2
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
3
4
- name : ' @smakss/random-string'
4
+ name : " @smakss/random-string"
5
5
6
6
on :
7
7
release :
@@ -11,21 +11,21 @@ jobs:
11
11
build :
12
12
runs-on : ubuntu-latest
13
13
steps :
14
- - uses : actions/checkout@v2
15
- - uses : actions/setup-node@v1
14
+ - uses : actions/checkout@v3
15
+ - uses : actions/setup-node@v3
16
16
with :
17
- node-version : 12
17
+ node-version : 16
18
18
19
19
publish-npm :
20
20
needs : build
21
21
runs-on : ubuntu-latest
22
22
steps :
23
- - uses : actions/checkout@v2
24
- - uses : actions/setup-node@v1
23
+ - uses : actions/checkout@v3
24
+ - uses : actions/setup-node@v3
25
25
with :
26
- node-version : 12
26
+ node-version : 16
27
27
registry-url : https://registry.npmjs.org/
28
- scope : ' @smakss'
28
+ scope : " @smakss"
29
29
- run : npm publish
30
30
env :
31
31
NODE_AUTH_TOKEN : ${{secrets.npm_token}}
@@ -34,12 +34,12 @@ jobs:
34
34
needs : build
35
35
runs-on : ubuntu-latest
36
36
steps :
37
- - uses : actions/checkout@v2
38
- - uses : actions/setup-node@v1
37
+ - uses : actions/checkout@v3
38
+ - uses : actions/setup-node@v3
39
39
with :
40
- node-version : 12
40
+ node-version : 16
41
41
registry-url : https://npm.pkg.github.com/
42
- scope : ' @smakss'
42
+ scope : " @smakss"
43
43
- run : npm publish
44
44
env :
45
45
NODE_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change @@ -17,13 +17,13 @@ yarn add @smakss/random-string
17
17
to include it with common js module you should do this:
18
18
19
19
``` js
20
- var randomString = require (' @smakss/random-string' );
20
+ var randomString = require (" @smakss/random-string" );
21
21
```
22
22
23
23
and to include it with ECMAscript module you can simply do this one:
24
24
25
25
``` js
26
- import randomString from ' @smakss/random-string' ;
26
+ import randomString from " @smakss/random-string" ;
27
27
```
28
28
29
29
## Examples of usage
@@ -37,24 +37,29 @@ randomString();
37
37
38
38
// Result: 'epTfoad497&p'
39
39
```
40
+
40
41
<sub >** NOTE:** If the input params were empty the length of string will be selected randomly between 1-20.<sub >
41
42
42
43
Generate a random string with a length of 10:
43
44
44
45
``` js
45
- randomString (10 );
46
+ randomString (10 );
46
47
47
- // Result: 'BD@Z8dKf2%'
48
+ // Result: 'BD@Z8dKf2%'
48
49
```
49
50
50
51
You can provide both length and allowed characters:
51
52
52
53
``` js
53
- randomString (10 , ' abCD#@' );
54
+ randomString (10 , " abCD#@" );
54
55
55
56
// Result: 'b@@#aDaC##'
56
57
```
57
58
58
59
## Demo
59
60
60
61
You can check the [ working demo] ( https://runkit.com/smakss/random-string ) in runkit.
62
+
63
+ or
64
+
65
+ [ ![ View @smakss/random-string ] ( https://codesandbox.io/static/img/play-codesandbox.svg )] ( https://codesandbox.io/s/smakss-random-string-xlf6d2?fontsize=14&hidenavigation=1&theme=dark )
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " @smakss/random-string" ,
3
- "version" : " 1.2.3" ,
2
+ "author" : " SMAKSS" ,
3
+ "bugs" : {
4
+ "url" : " https://github.com/SMAKSS/random-string/issues"
5
+ },
4
6
"description" : " Generates random dummy string with random length." ,
5
- "type" : " module" ,
6
- "main" : " index.cjs" ,
7
7
"exports" : {
8
8
"import" : " ./index.mjs" ,
9
9
"require" : " ./index.cjs"
10
10
},
11
- "repository" : {
12
- "type" : " git" ,
13
- "url" : " git+https://github.com/SMAKSS/random-string.git"
14
- },
11
+ "homepage" : " https://github.com/SMAKSS/random-string#readme" ,
15
12
"keywords" : [
16
13
" npm" ,
17
14
" yarn" ,
23
20
" EcmaScript" ,
24
21
" random-string"
25
22
],
26
- "author" : " SMAKSS" ,
27
23
"license" : " MIT" ,
28
- "bugs" : {
29
- "url" : " https://github.com/SMAKSS/random-string/issues"
24
+ "main" : " index.cjs" ,
25
+ "name" : " @smakss/random-string" ,
26
+ "repository" : {
27
+ "type" : " git" ,
28
+ "url" : " git+https://github.com/SMAKSS/random-string.git"
30
29
},
31
- "homepage" : " https://github.com/SMAKSS/random-string#readme"
30
+ "type" : " module" ,
31
+ "version" : " 1.2.4"
32
32
}
You can’t perform that action at this time.
0 commit comments