Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@intlify/utils
Advanced tools
Collection of i18n utilities
✅️ Modern: ES Modules first and respect Web Standard and ECMAScript Internationalization APIs
✅️ Compatible: support CommonJS and various JS environments
✅️️ Minimal: Small and fully tree-shakable
✅️️ Type Strong: Written in TypeScript, with full JSdoc
# Using npm
npm install @intlify/utils
# Using yarn
yarn add @intlify/utils
# Using pnpm
pnpm add @intlify/utils
If you are directly using @intlify/utils
as a dependency:
{
"dependencies": {
"@intlify/utils": "npm:@intlify/utils-edge@latest"
}
}
Note: Make sure to recreate lockfile and node_modules
after reinstall to avoid hoisting issues.
You can install via import
.
in your code:
/**
* you can install via other CDN URL such as skypack,
* or, you can also use import maps
* https://docs.deno.com/runtime/manual/basics/import_maps
*/
import { ... } from 'https://deno.land/x/intlify_utils/mod.ts'
// something todo
// ...
bun install @intlify/utils
in your HTML:
<script type="module">
/**
* you can install via other CDN URL such as skypack,
* or, you can also use import maps
*/
import { isLocale } from 'https://esm.sh/@intlify/utils'
// something todo
// ...
</script>
import { isLocale } from 'https://esm.sh/@intlify/utils-edge'
// something todo
// ...
You can play the below examples:
npm run play:node
npm run play:deno
npm run play:bun
npm run play:browser
isLocale
toLocale
parseAcceptLanguage
validateLangTag
normalizeLanguageName
You can do import { ... } from '@intlify/utils'
the above utilities
getNavigatorLocales
getNavigatorLocale
You can do import { ... } from '@intlify/utils'
the above utilities
[!NOTE] for Node.js You need to do
import { ... } from '@intlify/utils/node'
getHeaderLanguages
getHeaderLanguage
getHeaderLocales
getHeaderLocale
getCookieLocale
setCookieLocale
getPathLocale
getQueryLocale
tryHeaderLocales
tryHeaderLocale
tryCookieLocale
tryPathLocale
tryQueryLocale
The about utilies functions accpet Web APIs such as Request and Response that is supported by JS environments (such as Deno, Bun, and Browser)
If you will use Node.js and H3, You can do import { ... } from '@intlify/utils/{ENV}'
the above utilities.
The namespace {ENV}
is one of the following:
node
: accpet IncomingMessage
and Outgoing
by Node.js http moduleh3
: accept H3Event
by HTTP framework h3hono
: accept Context
by edge-side web framework honoIf you are interested in contributing to @intlify/utils
, I highly recommend checking out the contributing guidelines here. You'll find all the relevant information such as how to make a PR, how to setup development) etc., there.
FAQs
Collection of i18n utilities
The npm package @intlify/utils receives a total of 137,681 weekly downloads. As such, @intlify/utils popularity was classified as popular.
We found that @intlify/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.