You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ JagTag-JS is available on NPM and you can install it with `npm i @thesharks/jagt
25
25
Basic syntax:
26
26
27
27
```js
28
-
constJagTagParser=require('@thesharks/jagtag-js')
28
+
importJagTagParserfrom'@thesharks/jagtag-js'
29
29
30
30
JagTagParser('string to parse', argsObject)
31
31
```
@@ -37,7 +37,7 @@ For more information about the args object, see the [API reference](https://thes
37
37
At its most basic level, JagTag-JS can be used to perform simple string-related operations without any complications.
38
38
39
39
```js
40
-
constJagTagParser=require('@thesharks/jagtag-js')
40
+
importJagTagParserfrom'@thesharks/jagtag-js'
41
41
42
42
JagTagParser('change {upper:this} to uppercase')
43
43
// Returns 'change THIS to uppercase'
@@ -48,7 +48,7 @@ JagTagParser('change {upper:this} to uppercase')
48
48
More advanced operations may require you to pass arguments to the parser in order to function correctly. Please check the [documentation](https://thesharks.github.io/JagTag-JS/interfaces/interfaces_iparserarguments.iparserarguments.html) for information on what parser-level arguments need to be passed for which method.
49
49
50
50
```js
51
-
constJagTagParser=require('@thesharks/jagtag-js')
51
+
importJagTagParserfrom'@thesharks/jagtag-js'
52
52
53
53
JagTagParser('{argslen} arguments were passed to this tag', { tagArgs: [ 'item1', 'item2', 'item3' ] })
54
54
// Returns '3 arguments were passed to this tag'
@@ -59,7 +59,7 @@ JagTagParser('{argslen} arguments were passed to this tag', { tagArgs: [ 'item1'
59
59
Since Javascript will attempt to interpret strings such as `'\d'` as character escapes, it's recommended to call the parser using `String.raw`.
60
60
61
61
```js
62
-
constJagTagParser=require('@thesharks/jagtag-js')
62
+
importJagTagParserfrom'@thesharks/jagtag-js'
63
63
64
64
JagTagParser('{replaceregex:\d|with:#|in:I have 5 cats and 23 shirts}')
0 commit comments