node-elm-compiler
Advanced tools
Comparing version
13
index.js
@@ -154,2 +154,14 @@ 'use strict'; | ||
function compileToStringSync(sources, options) { | ||
if (typeof options.output === "undefined"){ | ||
options.output = '.js'; | ||
} | ||
const file = temp.openSync({ suffix: options.output }); | ||
options.output = file.path; | ||
compileSync(sources, options); | ||
return fs.readFileSync(file.path, {encoding: "utf8"}); | ||
} | ||
function handleError(pathToMake, err) { | ||
@@ -195,3 +207,4 @@ if (err.code === "ENOENT") { | ||
compileToString: compileToString, | ||
compileToStringSync: compileToStringSync, | ||
findAllDependencies: findAllDependencies | ||
}; |
{ | ||
"name": "node-elm-compiler", | ||
"version": "4.3.3", | ||
"version": "4.4.0", | ||
"description": "A Node.js interface to the Elm compiler binaries. Supports Elm version 0.17, 0.18", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,6 @@ # node-elm-compiler [](https://www.npmjs.com/package/node-elm-compiler) [](http://travis-ci.org/rtfeldman/node-elm-compiler) [](https://ci.appveyor.com/project/rtfeldman/node-elm-compiler/branch/master) | ||
## 4.4.0 | ||
Add `compileSync` | ||
## 4.3.1 | ||
@@ -19,0 +23,0 @@ |
317
3.26%106
3.92%15882
-0.74%10
-23.08%