fwew.js
v3.1.0
Published
JavaScript wrapper for the Fwew Na'vi Dictionary API written in TypeScript
Readme
fwew.js
Fwew, the powerful Na'vi dictionary search API, made accessible as an npm package written in TypeScript.
Features
- Search: Search for words in either direction or both at once
- List: List words with given properties
- Random: Get random words with given properties
- Numbers: Translate Na'vi numbers to and from Arabic numerals
- Names: Get Na'vi names in various formats, generated by Fwew API
Installation
Install fwew.js with your favorite package manager:
npm install fwew.js
yarn add fwew.js
pnpm add fwew.js
bun install fwew.jsUsage/Examples
Search Na'vi words
import { fwew } from 'fwew.js'
// async/await
async function demoFwew() {
const results = await fwew('kaltxì')
console.log(results)
}
// promise
fwew('kaltxì').then((results) => {
console.log(results)
})Search English → Na'vi
import { fwewReverse } from 'fwew.js'
// async/await
async function demoFwewReverse() {
const results = await fwewReverse('en', 'hello')
console.log(results)
}
// promise
fwewReverse('en', 'hello').then((results) => {
console.log(results)
})Search for both Na'vi → English and English → Na'vi
import { search } from 'fwew.js'
// async/await
async function demoSearch() {
const result = await search('en', 'kaltxì hello')
console.log(result)
}
// promise
search('en', 'kaltxì hello').then((results) => {
console.log(results)
})List words with given properties
import { list } from 'fwew.js'
// async/await
async function demoList() {
const results = await list('word starts tì and pos is n.')
console.log(results)
}
// promise
list('word starts tì and pos is n.').then((results) => {
console.log(results)
})Get random words
import { random } from 'fwew.js'
// async/await
async function demoRandom() {
const results = await random(8, 'pos is vtr.')
console.log(results)
}
// promise
random(8, 'pos is vtr.').then((results) => {
console.log(results)
})Translate Na'vi numbers
import { naviToNumber } from 'fwew.js'
// async/await
async function demoNaviToNumber() {
const result = await naviToNumber('mevopey')
console.log(result)
}
// promise
naviToNumber('mevopey').then((result) => {
console.log(result)
})Convert numbers to Na'vi
import { numberToNavi } from 'fwew.js'
// async/await
async function demoNumberToNavi() {
const result = await numberToNavi(42)
console.log(result)
}
// promise
numberToNavi(42).then((result) => {
console.log(result)
})Get Na'vi names
import { nameAlu, nameFull, nameSingle } from 'fwew.js'
// async/await
export async function demoNameAlu() {
const names = await nameAlu('10', '3', 'normal noun', 'any', 'forest')
console.log(names)
}
export async function demoNameFull() {
const names = await nameFull("'ite", '10', '3', '2', '2', 'forest')
console.log(names)
}
export async function demoNameSingle() {
const names = await nameSingle('10', '2', 'reef')
console.log(names)
}
// promise
nameAlu('10', '3', 'normal noun', 'any', 'forest').then((names) => {
console.log(names)
})
nameFull("'ite", '10', '3', '2', '2', 'forest').then((names) => {
console.log(names)
})
nameSingle('10', '2', 'reef').then((names) => {
console.log(names)
})