Skip to content

how to make a module

Ccode-lang edited this page Nov 1, 2021 · 6 revisions

How to start

Ccode modules are used by the import command.
Set up your project structure like:

module_name
-|
 |_module_name.js
 |
 |_com.txt

Put your functions in module_name.js then list them in com.txt with one extra newline at the end.

Example

module.js contents:

function test() {
    console.log("hello_world");
}
function test_func() {
    console.log("test");
}

com.txt contents:

test
test_func

Builtins.js's commands are available for use.

You can use any commands declared in Builtins.js.

Submit them to the package manager

Open a pull at the pack-list repo.

Warning

Don't import any commands in module files and try to use unique names for functions.

Welcome to the Ccode language wiki!

Clone this wiki locally