Skip to content

v0.0.7

Pre-release
Pre-release

Choose a tag to compare

@suchipi suchipi released this 25 Dec 19:53
· 788 commits to main since this release

There's lots of new stuff in here! Merry Christmas!

Additions:

  • added cat
  • yavascript's global APIs are now available as a separate library
    • you can use it together with qjsbootstrap to make your own binaries
  • added require.resolve (and std.resolveModule)
  • you can now require or import json
  • added printf
  • added os.execPath()
  • attempting to use mkdir, cp or other common commands which we have under a different name will now throw an error instructing you to use ensureDir, copy, etc instead
  • the parser now supports multiple shebangs at the top of a file (for nix)
  • Added parseScriptArgs (a command-line flag parser)
  • Added startRepl (start the repl from your own file, with your own globals)
  • We now support and provide binaries for linux arm
  • Added CSV.parse, CSV.stringify
  • Added YAML.parse, YAML.stringify
  • Added chmod
  • Added touch
  • Added assert function, as well as assert.string(...), assert.object(...), etc, which throw TypeErrors with useful messages if their argument isn't correct
  • Added grepString, grepFile, and String.prototype.grep
  • Added Module.define (create your own builtin modules)
  • Added String.cooked and String.dedent template tag helper functions
  • Added setTimeout, clearTimeout, setInterval and clearInterval

Changes:

  • Added Path class (represents a filesystem path) and moved functions from paths namespace onto that class (both as instance and static methods)
  • language (js/jsx/ts/coffee) will now be autodetected for files with no extension. previously, it always assumed js
  • you can now use --lang when running a file to specify the language for that file
    • it only affects the entrypoint file; all other imported/required files will have their lang determined by their extension or autodetect, as usual
  • cd() (with no argument) now goes to your home dir
  • when compiling yavascript from source, the version will now include the git sha and whether the worktree was clean or not
  • Help text now has colors (when stdout is a tty)
  • APIs are now lazy-loaded; not loaded until they're first used. This reduces startup time

Fixes/Other:

  • fixed a memory leak in require
  • Fixed lots of bugs with path string handling
  • Improved the automated test suite (in the git repo)
  • Other misc changes

Full Changelog: v0.0.6...v0.0.7