Skip to content

yorkie/rust.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust.js

Run your JavaScript apps backed by Rust.

Build

Prerequisites:

  • Rust 1.10.0+
  • Python 2.6 or 2.7
  • GNU Make 3.81 or newer
$ ./configure
$ make

Usage

rustjs 0.1.0
Yorkie Liu <yorkiefixer@gmail.com>
The platform lets you can work with Rust, C, C++ and JavaScript compatible with NPM and Cargo

USAGE:
  rustjs <INPUT> [FLAGS]

FLAGS:
    -h, --help       Prints help information
    -v, --version    Prints version information

POSITIONAL ARGUMENTS:
    INPUT      main script file

API References

  • assert This module is used for writing unit tests for your applications.
    • assert.equal()
    • assert.notEqual()
  • console Console object.
    • console.log()
    • console.info()
    • console.warn()
    • console.error()
  • crypto OpenSSL bindings.
    • crypto.version The text variant of the version number and the release date.
    • crypto.number OPENSSL_VERSION_NUMBER is a numeric release version identifier.
    • crypto.platform The "Configure" target of the library build in the form "platform: ..." if available or "platform: information not available" otherwise.
    • crypto.dir The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR: "..."" if available or "OPENSSLDIR: N/A" otherwise.
  • events Many objects in rust.js emit events.
    • events.EventEmitter
      • .on(name, listener)
      • .once(name, listener)
      • .removeAllEventListeners() remove all registered listeners on this emitter.
  • fs File I/O is provided by simple wrappers around standard POSIX functions.
    • fs.rename() rename the file.
    • fs.rmdir() remove the dir.
    • fs.mkdir() create the dir.
    • fs.stat() get the stat of the given pathname.
    • fs.readdir() read the directory.
    • fs.readFile() read the file of the given pathname.
    • fs.writeFile() write the file of the given pathname and bytes/string.
  • os Provides a few basic operating-system related utility functions.
    • fs.tmpdir()
    • fs.homedir()
    • fs.endianness()
    • fs.type()
    • fs.platform()
    • fs.arch()
  • path This module contains utilities for handling and transforming file paths.
    • path.normalize() normalize the path string.
    • path.isAbsolute() return if a path is in absolute.
    • path.dirname() return the directory name of the path.
    • path.basename() return the basename of the path.
    • path.extname() return the ext name.
  • url The URL parser/formatter based on servo/rust-url.
    • url.parse(): parse a url string.
    • url.format(): generate a string by url options.
  • util These functions are in the module 'util'.
    • util.isArray()
    • util.isFunction()
    • util.isBoolean()
    • util.isNull()
    • util.isNullOrUndefined()
    • util.isNumber()
    • util.isString()
    • util.isUndefined()
    • util.isRegExp()
    • util.isObject()
    • util.isDate()
    • util.isError()
    • util.isPrimitive()
    • util.inherits()

Development

Clone the repository

$ git clone git@github.com:yorkie/rust.js.git

Pull submodules

$ git submodule update --init --recursive

Build dependencies

$ ./configure && make

License

MIT