Skip to content

Commit

Permalink
Require Node.js 14
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 4, 2022
1 parent 2f9f551 commit e37087b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 30 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ jobs:
fail-fast: false
matrix:
node-version:
- 18
- 16
- 14
- 12
- 10
- 8
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare const lcid: {
@example
```
import lcid = require('lcid');
import lcid from 'lcid';
lcid.from(1044);
//=> 'nb_NO'
Expand All @@ -19,7 +19,7 @@ declare const lcid: {
@example
```
import lcid = require('lcid');
import lcid from 'lcid';
lcid.to('nb_NO');
//=> 1044
Expand All @@ -32,7 +32,7 @@ declare const lcid: {
@example
```
import lcid = require('lcid');
import lcid from 'lcid';
lcid.all;
//=> {'af_ZA': 1078, …}
Expand Down
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
"description": "Mapping between standard locale identifiers and Windows locale identifiers (LCID)",
"license": "MIT",
"repository": "sindresorhus/lcid",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"engines": {
"node": ">=8"
"node": ">=14.16"
},
"scripts": {
"test": "xo && ava && tsd"
Expand Down Expand Up @@ -45,5 +50,11 @@
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"xo": {
"rules": {
"import/extensions": "off",
"import/no-unresolved": "off"
}
}
}
21 changes: 2 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@

> Mapping between [standard locale identifiers](https://en.wikipedia.org/wiki/Locale_(computer_software)) and [Windows locale identifiers (LCID)](https://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms)
Based on the [mapping](https://github.com/python/cpython/blob/8f7bb100d0fa7fb2714f3953b5b627878277c7c6/Lib/locale.py#L1465-L1674) used in the Python standard library.

The mapping itself is just a [JSON file](lcid.json) and can be used anywhere.


## Install

```
```sh
$ npm install lcid
```


## Usage

```js
const lcid = require('lcid');
import lcid from 'lcid';

lcid.from(1044);
//=> 'nb_NO'
Expand All @@ -28,16 +24,3 @@ lcid.to('nb_NO');
lcid.all;
//=> {'af_ZA': 1078, …}
```


---

<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-lcid?utm_source=npm-lcid&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

0 comments on commit e37087b

Please sign in to comment.