From 570e2df6d323129740f09e902bd5b2805a98a905 Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Wed, 14 Aug 2024 14:51:13 -0700 Subject: [PATCH] migrate JS example to ESM --- README.md | 2 +- js/{example.js => example.mjs} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename js/{example.js => example.mjs} (95%) diff --git a/README.md b/README.md index 4a22d6a4..2d7d19ad 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ It may be a good fit for yours, too! See [docs.rs](https://docs.rs/adblock) for detailed API documentation. -Also check the [Rust example](./examples/example.rs) or the [NodeJS example](./js/example.js). +Also check the [Rust example](./examples/example.rs) or the [NodeJS example](./js/example.mjs). ### Optional features diff --git a/js/example.js b/js/example.mjs similarity index 95% rename from js/example.js rename to js/example.mjs index d9c01afb..2e151655 100644 --- a/js/example.js +++ b/js/example.mjs @@ -1,5 +1,5 @@ -const adblockRust = require('adblock-rs'); -const fs = require('fs'); +import adblockRust from 'adblock-rs'; +import fs from 'node:fs'; const dataPath = '../data/' const debugInfo = true;