Skip to content

Commit

Permalink
Es6 example (#29)
Browse files Browse the repository at this point in the history
* Create package.json

* Create index.js
  • Loading branch information
sajaddp authored Oct 8, 2022
1 parent 01dc009 commit 1498aef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions example/es6/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { readFile } from "fs/promises";

const cities = JSON.parse(
await readFile(new URL("../../json/cities.json", import.meta.url))
);

const provinces = JSON.parse(
await readFile(new URL("../../json/provinces.json", import.meta.url))
);

console.log("---------", cities);
console.log("<br>", "---------", provinces);
12 changes: 12 additions & 0 deletions example/es6/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "list-of-cities-in-iran",
"version": "1.2.0",
"description": "List of cities in Iran",
"type": "module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Sajad Dehshiri <[email protected]>",
"license": "ISC"
}

0 comments on commit 1498aef

Please sign in to comment.