New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-elm-compile-string

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-elm-compile-string

Compile Elm code directly from a string

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

node-elm-compile-string Build Status

Elm compiler wrapper as a function - receives a code string and outputs the compiled result as a JS or HTML string using promises.

It'll load some basic packages for you, and do it from cache so it'll run fast.

This should be used only if you want to compile simple Elm code on demand, from a string. Otherwise, see node-elm-compiler

You must have the Elm compiler installed in order for this to work.

Install

$ npm install --save node-elm-compile-string

Usage

const compileElm = require('node-elm-compile-string');
const elmCode = `
import Html exposing (text)

main =
  text "Hello, World!"
`
nodeElmCompile(elmCompile)
	.then(compiledCode => {
		doCoolThingsWithIt(compiledCode); //compiledCode will hold either the compiled html or js
	}, err => {
		console.error(err);
	});

API

nodeElmCompile(elmCode, [options])

elmCode

Type: string

Elm code that needs to be compiled

options

output

Type: string
Default: html

Control whether the compiled should output html or js code.

License

MIT © GabiG

FAQs

Package last updated on 06 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts