To use GoCenter:
export GOPROXY=https://gocenter.io
bitbucket.org/lygo/lygo_ext_scripting
January 1st 0001
Last Modified
0
Stars
AGPL-3.0
License
144
Downloads
ReadMe
Mod File
GoDocs
New
Security
Dependencies (0)
Used By (0)
Metrics
Versions
Scripting
Scripting is a Javascript engine with “modules” implementation.
How to Use
To use just call:
go get -u bitbucket.org/lygo/lygo_ext_scripting
Sample
var path = require("path");
(function(){
var response = {
delimiter: path.delimiter,
sep: path.sep,
dirname: path.dirname("/dir/dir2/dir3/file"),
basename: path.basename("/dir/dir2/dir3/file.html", ".html"),
extname: path.extname("/dir/dir2/dir3/file.html"),
format: path.format({
"dir":"/home/dir1",
"base":"file.html"
}),
isAbsolute: path.isAbsolute("/dir/dir2/dir3/file.html"),
isAbsolute2: path.isAbsolute("file.html"),
join: path.join("/dir/dir2", "dir3", "file.html", ".."),
normalize: path.normalize('/foo/bar//baz/asdf/quux/..'),
parse: path.parse('/foo/bar/baz/asdf/quux/file.txt'),
relative: path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb'),
resolve: path.resolve('/foo/bar', './baz'),
resolve2: path.resolve('/foo/bar', '/tmp/file/'),
resolve3: path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif'),
};
var s = JSON.stringify(response);
console.debug(s);
return s;
})();
Modules
- auth0 : JWT support with SignIn and SignUp helpers
- fs : File System Module
- http : Http Client and Http Server (Express like) implementation
- line-reader: Utility to read text files line-by-line
- nio: Client/Server Network I/O
- nodemailer: Send Emails
- path: Path utilities
- sql: SQL implementation for MySQL and all supported drivers
- sys: System utilities and information
- crypto-utils: Utility for cryptography
- file-utils: Utility for file R/W
- date-utils: Utility for date parsing, formatting and manipulation
- template-utils: Utility for template merging
How To Write Your Own Modules
TODO: write documentation….
Dependencies
This module depend on Goja
go get -u github.com/dop251/goja/...
And some LyGo Modules:
go get -u bitbucket.org/lygo/lygo_commons
go get -u bitbucket.org/lygo/lygo_num2word
go get -u bitbucket.org/lygo/lygo_ext_logs
go get -u bitbucket.org/lygo/lygo_nio
go get -u bitbucket.org/lygo/lygo_nio
go get -u bitbucket.org/lygo/lygo_ext_auth0
go get -u bitbucket.org/lygo/lygo_ext_sms
SQL Dependencies
go get -u github.com/go-sql-driver/mysql
NoSQL Dependencies
ArangoDB:
go get github.com/arangodb/go-driver
go get github.com/arangodb/go-driver/http
Versioning
Sources are versioned using git tags:
git tag v0.1.66
git push origin v0.1.66