You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 23, 2018. It is now read-only.
Onoshko Dan edited this page Jan 10, 2015
·
5 revisions
ColaScript supports exits CommonJS modules and have syntax to create them.
With @import command you can import modules:
@import'sugar'// import all items in current scope
@import'fs'asfs
@importdirnamefrom'path'
@importprintasecho,promptasask,testfrom'mylib'Stringcode=fs.readFileSync(dirname(test)+"/main.cola","utf8");echo("hello!");
With @export command you can export and re-export components:
Objecthash={};Arrayusers=[];
@exporthashas_,users
@exporteachasforEachfrom"underscore"
@export"mylib"// re-export all
To associate package names with sources you should create packages.json file. You can generate this file with Dr Package.