Skip to content

br0kenpixel/funjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FunJS

FunJS is a simple JavaScript runtime for educational purposes. It's based on deno_core.

## funjs module

File I/O

The funjs.fs module contains functions for performing basic file I/O.

var content = funjs.fs.readFile("README.md");
funjs.fs.writeFile("README.md.copy", content);

// List files in a directory
var items = funjs.fs.listDir("src");
console.log(items);

Math

var nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

funjs.math.min(nums); // 1
funjs.math.max(nums); // 10
funjs.math.sum(nums); // 55

Random

funjs.random.range(1, 10);       // exclusive range
funjs.random.range(1, 10, true); // inclusive range

Runtime

console.log(funjs.runtime.version()); // Displays the version of this crate