Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
* fix: typo in package.json
* fix: remove export shim
* docs: updated examples
  • Loading branch information
vHeemstra authored Jul 10, 2024
2 parents ee7e917 + 69e6de2 commit 01678f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "4.0.1",
"description": "Create pre-filled PO files from POT file, using previous PO files.",
"type": "module",
"main": "./dist/index.mjs",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"dev": "npm run build -- --watch src",
Expand Down
18 changes: 9 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>
> _Based on the POT filename or set options, it looks for source PO files. For each PO file, it will create a new one, based on the contents of the POT file. The source PO file is used to fill in the matching translated strings._
>
> **_This package now supports both ESM and CommonJS_** 🎉
> **_This package now only supports ESM. For CommonJS use version 3._** 🎉
## Use case

Expand Down Expand Up @@ -53,10 +53,10 @@ Processes the POT files and found PO files in parallel.
</tr>
</table>

#### Example (CommonJS)
#### Example (ESM)

```js
const fillPotPo = require('fill-pot-po');
import fillPotPo from "fill-pot-po";

const cb = (results) => {
// ...
Expand All @@ -65,10 +65,10 @@ const cb = (results) => {
fillPotPo(cb, options);
```

#### Example (ESM)
#### Example (CommonJS - only with versions <= 3)

```js
import fillPotPo from 'fill-pot-po';
const fillPotPo = require("fill-pot-po");

const cb = (results) => {
// ...
Expand Down Expand Up @@ -102,10 +102,10 @@ Processes the POT files and found PO files in series (slower).
</tr>
</table>

#### Example (CommonJS)
#### Example (ESM)

```js
const fillPotPoSync = require('fill-pot-po').sync;
import { sync as fillPotPoSync } from "fill-pot-po";

try {
const results = fillPotPoSync(options);
Expand All @@ -116,10 +116,10 @@ try {
}
```

#### Example (ESM)
#### Example (CommonJS - only with versions <= 3)

```js
import { sync as fillPotPoSync } from 'fill-pot-po';
const fillPotPoSync = require("fill-pot-po").sync;

try {
const results = fillPotPoSync(options);
Expand Down

0 comments on commit 01678f9

Please sign in to comment.