2.7.1 • Published 11 months ago
enclst-core-js v2.7.1
Enclist-core-js
This is a library for javascript to handle Enclst data.
install
yarn add enclst-core-jsHow to use
Read EncLst
From file
import { EncLst} from 'enclst-core-js'
import * as fs from "node:fs/promises";
const path = "path/of/enclst.enclst"
let str = await fs.readFile('test/data/test02.enclst', { encoding: "utf8" })
let enclst = new EncLst(str)From network
import { EncLst} from 'enclst-core-js'
const url = "https://github.com/UedaTakeyuki/EncLst/blob/main/examples/EncycloList/lang/en/en.enclst"
let enclst = {}
const res = await fetch(this.url)
if (res.status == 200) {
const data = await res.text();
enclst = new EncLst(data)
}get title
get title of the enclst
console.log(enclst.title)get title of an item
console.log(enclst.items[0].title)get value
const value = enclst.items[0].value
if (value.hasParams()){
console.log(value.first()) // first positional parameter
}
if (value.hasPositinalParams()){
console.log(value.positional[0]) // first positional parameter
}
if (value.hasNamedParams()){
if ('aho' in value.named){
console.log(value.named['aho']) // named by 'aho'
}
}API
How to make
yarn makedocAPI documents will be created to docs folder.
Latest API document
latest document is available here.
Test
yarn testThe test environment was set up according to this blog.
Version
- V1: Original API
- V2: Made API consistent with the dart version.
2.7.0
11 months ago
2.7.1
11 months ago
2.3.0
12 months ago
2.5.0
12 months ago
2.4.0
12 months ago
2.6.1
12 months ago
2.5.2
12 months ago
2.6.0
12 months ago
2.5.1
12 months ago
2.6.3
12 months ago
2.6.2
12 months ago
2.2.1
1 year ago
2.1.2
1 year ago
2.2.3
1 year ago
2.1.4
1 year ago
2.2.2
1 year ago
2.1.3
1 year ago
2.2.5
12 months ago
2.2.4
1 year ago
2.2.6
12 months ago
2.1.1
2 years ago
2.0.3
2 years ago
2.0.2
2 years ago
2.0.1
2 years ago
1.0.20
2 years ago
1.0.19
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago