File tree Expand file tree Collapse file tree 6 files changed +9
-9
lines changed Expand file tree Collapse file tree 6 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
// node hello.js
2
2
3
- var quranMeta = require ( "../dist/quran-meta.common.js " )
3
+ var quranMeta = require ( "../dist/index.cjs " )
4
4
console . log ( " Hello World! " ) // => 'Hello World'
5
5
console . log ( `There are ${ quranMeta . meta . numSuras } suras in the Holy Quran` ) // => '3 red apples'); // => '3 red apples'
Original file line number Diff line number Diff line change 1
1
// start with
2
- // node hello-es .mjs
2
+ // node hello.mjs
3
3
4
- import { meta } from "../dist/quran-meta.js "
4
+ import { meta } from "../dist/index.mjs "
5
5
console . log ( "hello" )
6
6
//console.log(`There are ${meta.numSuras} suras in the Holy Quran`)
7
7
console . log ( `There are ${ meta . numSuras } suras in the Holy Quran` )
Original file line number Diff line number Diff line change 1
1
< html >
2
- < script src ="../dist/quran-meta .js " type ="text/javascript "> </ script >
2
+ < script src ="../dist/index .js " type ="text/javascript "> </ script >
3
3
Once library is included global variable `quranMeta` is exposed:
4
4
< script type ="text/javascript ">
5
5
console . log ( "hello" )
Original file line number Diff line number Diff line change 2
2
Once library is included local variable `quranMeta` is exposed inside module script:
3
3
4
4
< script type ="module ">
5
- import { meta } from "../../dist/quran-meta.esm.js "
5
+ import { meta } from "../../dist/index.mjs "
6
6
console . log ( "hello" )
7
7
console . log ( meta )
8
8
alert ( `There are ${ meta . numSuras } suras in the Holy Quran` )
Original file line number Diff line number Diff line change 1
1
/**
2
2
* This example creates list of [surah,ayah] number pairs in Holy Quran
3
3
*/
4
- // node sample-cjs.js
4
+ // node sample.cjs
5
5
6
6
// const quranMeta = require("../dist/quran-meta.common.js")
7
- const quranMeta = require ( "../lib_cjs /index.js " )
7
+ const quranMeta = require ( "../dist /index.cjs " )
8
8
console . log ( `There are ${ quranMeta . meta . numSuras } suras in the Holy Quran` )
9
9
const res = [ ]
10
10
for ( let surah = 1 ; surah <= quranMeta . meta . numSuras ; surah ++ ) {
Original file line number Diff line number Diff line change 1
1
/**
2
2
* This example creates list of [surah,ayah] number pairs in Holy Quran
3
3
*/
4
- // node sample-es .mjs
4
+ // node sample.mjs
5
5
6
- import { meta , SuraList } from "../dist/quran-meta.js "
6
+ import { meta , SuraList } from "../dist/index.mjs "
7
7
console . log ( `There are ${ meta . numSuras } suras in the Holy Quran` )
8
8
const res = [ ]
9
9
for ( let surah = 1 ; surah <= meta . numSuras ; surah ++ ) {
You can’t perform that action at this time.
0 commit comments