Socket
Socket
Sign inDemoInstall

y18n

Package Overview
Dependencies
0
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1 to 4.0.2

build/index.cjs

52

CHANGELOG.md

@@ -5,11 +5,10 @@ # Change Log

### [4.0.2](https://www.github.com/yargs/y18n/compare/y18n-v4.0.1...y18n-v4.0.2) (2021-04-07)
### 4.0.1 (2020-11-30)
### Bug Fixes
* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/a9ac604abf756dec9687be3843e2c93bfe581f25))
* **security:** ensure entry exists for backport ([#120](https://www.github.com/yargs/y18n/issues/120)) ([b22c0df](https://www.github.com/yargs/y18n/commit/b22c0df59d0851d7be9fd1d51f6a5ee974c9fc94))
<a name="4.0.0"></a>
# [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10)
### [5.0.4](https://www.github.com/yargs/y18n/compare/v5.0.3...v5.0.4) (2020-10-16)

@@ -19,2 +18,47 @@

* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#105](https://www.github.com/yargs/y18n/issues/105)) ([4f85d80](https://www.github.com/yargs/y18n/commit/4f85d80dbaae6d2c7899ae394f7ad97805df4886))
### [5.0.3](https://www.github.com/yargs/y18n/compare/v5.0.2...v5.0.3) (2020-10-16)
### Bug Fixes
* **exports:** node 13.0-13.6 require a string fallback ([#103](https://www.github.com/yargs/y18n/issues/103)) ([e39921e](https://www.github.com/yargs/y18n/commit/e39921e1017f88f5d8ea97ddea854ffe92d68e74))
### [5.0.2](https://www.github.com/yargs/y18n/compare/v5.0.1...v5.0.2) (2020-10-01)
### Bug Fixes
* **deno:** update types for deno ^1.4.0 ([#100](https://www.github.com/yargs/y18n/issues/100)) ([3834d9a](https://www.github.com/yargs/y18n/commit/3834d9ab1332f2937c935ada5e76623290efae81))
### [5.0.1](https://www.github.com/yargs/y18n/compare/v5.0.0...v5.0.1) (2020-09-05)
### Bug Fixes
* main had old index path ([#98](https://www.github.com/yargs/y18n/issues/98)) ([124f7b0](https://www.github.com/yargs/y18n/commit/124f7b047ba9596bdbdf64459988304e77f3de1b))
## [5.0.0](https://www.github.com/yargs/y18n/compare/v4.0.0...v5.0.0) (2020-09-05)
### ⚠ BREAKING CHANGES
* exports maps are now used, which modifies import behavior.
* drops Node 6 and 4. begin following Node.js LTS schedule (#89)
### Features
* add support for ESM and Deno [#95](https://www.github.com/yargs/y18n/issues/95)) ([4d7ae94](https://www.github.com/yargs/y18n/commit/4d7ae94bcb42e84164e2180366474b1cd321ed94))
### Build System
* drops Node 6 and 4. begin following Node.js LTS schedule ([#89](https://www.github.com/yargs/y18n/issues/89)) ([3cc0c28](https://www.github.com/yargs/y18n/commit/3cc0c287240727b84eaf1927f903612ec80f5e43))
## [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10)
### Bug Fixes
* allow support for falsy values like 0 in tagged literal ([#45](https://github.com/yargs/y18n/issues/45)) ([c926123](https://github.com/yargs/y18n/commit/c926123))

@@ -21,0 +65,0 @@

77

package.json
{
"name": "y18n",
"version": "4.0.1",
"version": "4.0.2",
"description": "the bare-bones internationalization library used by yargs",
"main": "index.js",
"scripts": {
"pretest": "standard",
"test": "nyc mocha",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"release": "standard-version"
"exports": {
".": [
{
"import": "./index.mjs",
"require": "./build/index.cjs"
},
"./build/index.cjs"
]
},
"repository": {
"type": "git",
"url": "git@github.com:yargs/y18n.git"
},
"files": [
"index.js"
],
"type": "module",
"module": "./build/lib/index.js",
"keywords": [

@@ -24,17 +21,51 @@ "i18n",

],
"author": "Ben Coe <ben@npmjs.com>",
"license": "ISC",
"homepage": "https://github.com/yargs/y18n",
"bugs": {
"url": "https://github.com/yargs/y18n/issues"
},
"homepage": "https://github.com/yargs/y18n",
"repository": "yargs/y18n",
"license": "ISC",
"author": "Ben Coe <bencoe@gmail.com>",
"main": "./build/index.cjs",
"scripts": {
"check": "standardx '**/*.ts' '**/*.cjs' '**/*.mjs'",
"fix": "standardx --fix '**/*.ts' '**/*.cjs' '**/*.mjs'",
"pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
"test": "c8 --reporter=text --reporter=html mocha test/*.cjs",
"test:esm": "c8 --reporter=text --reporter=html mocha test/esm/*.mjs",
"posttest": "npm run check",
"coverage": "c8 report --check-coverage",
"precompile": "rimraf build",
"compile": "tsc",
"postcompile": "npm run build:cjs",
"build:cjs": "rollup -c",
"prepare": "npm run compile"
},
"devDependencies": {
"@types/node": "^14.6.4",
"@wessberg/rollup-plugin-ts": "^1.3.1",
"c8": "^7.3.0",
"chai": "^4.0.1",
"coveralls": "^3.0.0",
"mocha": "^4.0.1",
"nyc": "^11.0.1",
"rimraf": "^2.5.0",
"standard": "^10.0.0-beta.0",
"standard-version": "^4.2.0"
"cross-env": "^7.0.2",
"gts": "^3.0.0",
"mocha": "^8.0.0",
"rimraf": "^3.0.2",
"rollup": "^2.26.10",
"standardx": "^5.0.0",
"ts-transform-default-export": "^1.0.2",
"typescript": "^4.0.0"
},
"files": [
"build",
"index.mjs",
"!*.d.ts"
],
"engines": {
"node": ">=10"
},
"standardx": {
"ignore": [
"build"
]
}
}
# y18n
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![NPM version][npm-image]][npm-url]

@@ -18,5 +16,5 @@ [![js-standard-style][standard-image]][standard-url]

```js
var __ = require('y18n').__
const __ = require('y18n')().__;
console.log(__('my awesome string %s', 'foo'))
console.log(__('my awesome string %s', 'foo'));
```

@@ -31,6 +29,7 @@

```js
var __ = require('y18n').__
var str = 'foo'
const __ = require('y18n')().__;
console.log(__`my awesome string ${str}`)
const str = 'foo';
console.log(__`my awesome string ${str}`);
```

@@ -45,5 +44,5 @@

```js
var __n = require('y18n').__n
const __n = require('y18n')().__n;
console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'))
console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'));
```

@@ -55,2 +54,19 @@

## Deno Example
As of `v5` `y18n` supports [Deno](https://github.com/denoland/deno):
```typescript
import y18n from "https://deno.land/x/y18n/deno.ts";
const __ = y18n({
locale: 'pirate',
directory: './test/locales'
}).__
console.info(__`Hi, ${'Ben'} ${'Coe'}!`)
```
You will need to run with `--allow-read` to load alternative locales.
## JSON Language Files

@@ -102,2 +118,8 @@

## Supported Node.js Versions
Libraries in this ecosystem make a best effort to track
[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a
post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
## License

@@ -107,6 +129,2 @@

[travis-url]: https://travis-ci.org/yargs/y18n
[travis-image]: https://img.shields.io/travis/yargs/y18n.svg
[coveralls-url]: https://coveralls.io/github/yargs/y18n
[coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg
[npm-url]: https://npmjs.org/package/y18n

@@ -113,0 +131,0 @@ [npm-image]: https://img.shields.io/npm/v/y18n.svg

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc