diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18531b3..d50ada6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/index.d.ts b/index.d.ts index a306c2d..9545005 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,7 +6,7 @@ declare const lcid: { @example ``` - import lcid = require('lcid'); + import lcid from 'lcid'; lcid.from(1044); //=> 'nb_NO' @@ -19,7 +19,7 @@ declare const lcid: { @example ``` - import lcid = require('lcid'); + import lcid from 'lcid'; lcid.to('nb_NO'); //=> 1044 @@ -32,7 +32,7 @@ declare const lcid: { @example ``` - import lcid = require('lcid'); + import lcid from 'lcid'; lcid.all; //=> {'af_ZA': 1078, …} diff --git a/license b/license index e7af2f7..fa7ceba 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (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: diff --git a/package.json b/package.json index a5661c5..ad78d3b 100644 --- a/package.json +++ b/package.json @@ -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" @@ -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" + } } } diff --git a/readme.md b/readme.md index b637bd2..e95b38b 100644 --- a/readme.md +++ b/readme.md @@ -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' @@ -28,16 +24,3 @@ lcid.to('nb_NO'); lcid.all; //=> {'af_ZA': 1078, …} ``` - - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-