New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

i18njs

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18njs - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"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",

# 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 &#x27;&lt;the&gt;&#x27; &#x60;&amp;&#x60; &quot;World&quot;"
```
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%>`
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc