diff options
author | Louis Pilfold <louis@lpil.uk> | 2021-07-31 11:26:38 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2021-07-31 11:26:38 +0100 |
commit | f78920f014e2e2b3d512bd5703902bbdba68eb4f (patch) | |
tree | a8dbc823a3223fb67f2d8e34ef4287f4de3f161d /src/gleam_stdlib.js | |
parent | 942521b3016af2f24bff4eb1237c01a7856ffea5 (diff) | |
download | gleam_stdlib-f78920f014e2e2b3d512bd5703902bbdba68eb4f.tar.gz gleam_stdlib-f78920f014e2e2b3d512bd5703902bbdba68eb4f.zip |
Move atom module to gleam_erlang library
Diffstat (limited to 'src/gleam_stdlib.js')
-rw-r--r-- | src/gleam_stdlib.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gleam_stdlib.js b/src/gleam_stdlib.js index 68ab895..1e93901 100644 --- a/src/gleam_stdlib.js +++ b/src/gleam_stdlib.js @@ -199,3 +199,11 @@ export function bit_string_to_string(bit_string) { return gleam_error(undefined); } } + +export function print(string) { + if (typeof process === "object") { + process.stdout.write(string); // We can write without a trailing newline + } else { + console.log(string); // We're in a browser. Newlines are mandated + } +} |