+1
-1
| { | ||
| "name": "i18njs", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "A simple i18n for Javascript with a templating feature.", | ||
@@ -5,0 +5,0 @@ "main": "i18njs.js", |
+17
-3
| # i18njs | ||
| --- | ||
| A simple i18n for Javascript with a templating feature. | ||
@@ -12,3 +10,5 @@ | ||
| ```node | ||
| npm install --save i18njs | ||
| ``` | ||
@@ -19,5 +19,7 @@ | ||
| ```node | ||
| bower install --save i18njs | ||
| ``` | ||
| ``` | ||
| ## Usage | ||
@@ -32,2 +34,3 @@ | ||
| ```javascript | ||
| var en = { | ||
@@ -41,2 +44,3 @@ 'hello_world': { | ||
| i18n.add('en', 'first_test', en); | ||
| ``` | ||
@@ -47,3 +51,5 @@ | ||
| ```javascript | ||
| i18n.lng = 'fr'; | ||
| ``` | ||
@@ -54,4 +60,6 @@ | ||
| ```javascript | ||
| // i18n.get(key, data, options); | ||
| i18n.get('first_test.hello_world.hello'); // Hello | ||
| ``` | ||
@@ -66,2 +74,3 @@ | ||
| ```javascript | ||
| var en = { | ||
@@ -79,6 +88,9 @@ 'st': '{{=interpolate}} {{for(var i = 0, max = 1; i < max; i += 1) {}}to{{}}} {{-escape}}' | ||
| // "Hello to '<the>' `&` "World"" | ||
| ``` | ||
| You can also change delimeters by passing the third `options` arguments | ||
| ```javascript | ||
| var st = i18n.get('st', data, { | ||
@@ -89,4 +101,6 @@ evaluate: /<%([\s\S]+?)%>/g; | ||
| }); | ||
| ``` | ||
| Will result in `<%=interpolate%>`, `<%evaluate%>` or `<%-escape%>` | ||
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
16296
0.14%98
16.67%