livescript-transform-top-level-await

1.0.2 • Public • Published

Transform plugin for livescript

Enables use of await in top level block.

This isn't real plugin because livescript doesn't have support for it. It's more like a hack thats is mutating AST generated by livescript.

Usage

Assuming you have file name app.ls

simple use

require! <[ livescript livescript-transform-top-level-await]>
foo = Promise.resolve \foo
bar = Promise.resolve \bar
foo-bar = "#{await foo} #{await bar}"

installing inside custom livescript implementation

require! <[ livescript livescript-transform-top-level-await/lib/plugin]>
plugin.install livescript
livescript.compile source-code

CLI

Please stop using cli for any serious task, write scripts in real languages (there are so many to choose) e.g.

lsc serious-task.ls  
node serious-task.js
python serious-task.py

If you really must to use cli just add require plugin file to the command.
But don't say I didn't warn you!

compiling

lsc -cr livescript-transform-top-level-await app.ls

running

lsc -r livescript-transform-top-level-await app.ls

License

BSD-3-Clause

Dependents (1)

Package Sidebar

Install

npm i livescript-transform-top-level-await

Weekly Downloads

0

Version

1.0.2

License

BSD-3-Clause

Unpacked Size

6.73 kB

Total Files

9

Last publish

Collaborators

  • ketrab