Skip to content

randkid/Wrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wrap

CSV preprocessor for Randkid materials

Use (Deno)

Convert CSV to JS

convert.ts

import {weightedList} from "https://raw.githubusercontent.com/randkid/Wrap/master/mod.ts"
await weightedList.convert("data.csv", "data.js")
deno run --allow-read --allow-write convert.ts

Generate "Material" from JS

mod.ts

import {weightedList} from "https://raw.githubusercontent.com/randkid/Wrap/master/mod.ts"
import data from "./data.js"
export default weightedList.getMaterial(data)

Use "Material"

Refer to Randkid.

import material from "./mod.ts"
console.log(material.rand(Math.random()))

Why is this necessary?

CSV file can't be imported.
This provides importable JS file.

About

CSV preprocessor for Randkid materials

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published