Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d491ef

Browse files
committed
Update GettingStarted
1 parent 7d1e332 commit 4d491ef

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

GettingStarted.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ elixirscript also takes a path to your `.ex` files as well:
4848

4949
If you look in the dist folder you'll see a file called `Elixir.App.js`
5050

51+
To start your application import the bundle according to whichever module format was selected and
52+
then call start giving it the module and the initial args.
53+
54+
Ex. If you have a module like so
55+
```elixir
56+
defmodule Example do
57+
start(type, args) do
58+
:console.log("Hello, world")
59+
end
60+
end
61+
```
62+
63+
You would start it like so
64+
65+
```javascript
66+
//ES module example
67+
import Elixir from './Elixir.App'
68+
Elixir.start(Elixir.Example, [])
69+
```
70+
5171
### Mix dependency
5272

5373
Adding Elixirscript to your mix project gives you the ability to add it to your list of mix compilers. This means when you `mix compile`, Elixirscript will compile your code as well.

0 commit comments

Comments
 (0)