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

@loveholidays/phrasebook

Package Overview
Dependencies
Maintainers
15
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loveholidays/phrasebook - npm Package Compare versions

Comparing version 0.0.4 to 1.0.0

6

CHANGELOG.md
# @loveholidays/phrasebook
## 1.0.0
### Major Changes
- 4107522: V1 release
## 0.0.4

@@ -4,0 +10,0 @@

2

package.json
{
"name": "@loveholidays/phrasebook",
"version": "0.0.4",
"version": "1.0.0",
"description": "A lightweight drop-in for i18next users",

@@ -5,0 +5,0 @@ "sideEffects": false,

# Phrasebook
A lightweight drop-in for i18next users looking to translate their projects.
A lightweight drop-in for `react-i18next` users looking to translate their projects. Currently in production on www.loveholidays.com.
loveholidays made Phrasebook for our [website](https://www.loveholidays.com/).
## Why phrasebook?
It supports tree-shaking, and generates less JavaScript than i18next.
- Tree-shakeable
- Like for like interface with `react-i18next`
- Native ESM module
- Small bundle size (<1kb)
Phrasebook supports tree shaking to help reduce the client side bundle. On our site this saved us 12kB compared to using i18next.
We leverage `TFunction` types in our site which are not exported properly from `i18next` without including the entire bundle. With this package you have all the types you need alongside a fully working set of functions that translate i18next files.
## Usage
This package uses native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and does not provide a CommonJS export.
### Bundle size comparisons
| Package | Bundle size | Difference |
| ------------------------ | ----------------------------------------------------------------------- | ------------------------------- |
| react-i18next | [6.5kb](https://bundlephobia.com/package/react-i18next@11.16.2) | |
| @loveholidays/phrasebook | [883b](https://bundlephobia.com/package/@loveholidays/phrasebook@0.0.4) | 736% smaller than react-i18next |
| @lingui/react | [2.5kb](https://bundlephobia.com/package/@lingui/react@3.13.2) | 260% smaller than react-i18next |
## Installation
Currently available on [NPM](https://www.npmjs.com/package/@loveholidays/phrasebook)
```
$ npm i @loveholidays/phrasebook --save
```
### Usage
As this is a drop-in replacement usage is the same as i18next. For example if you are currently using react-i18next you can replace you imports like so:

@@ -14,0 +35,0 @@

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