npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

elm-loader

v0.14.6

Published

An easy way to load Elm files in Node.

Readme

Node Elm Loader

A simple way to interoperate between Elm and NodeJS. Useful for sharing code between display and model logic, which holding it together with the rich Node ecosystem, for example, building your client-side components and minifying them with the rest of your assets!

Installation

You will need to already have the Elm platform installed on your system. Please find the relevant instructions here and a NodeJS development environment for v0.10.x.

Then, simply add elm-loader as a dependency in your package.json or run npm -g elm-loader.

Usage

First, write a simple module in Elm and expose a port! Due to a current bug in the compiler, you need to supply a dummy main function. Once this is resolved, it will be possible to proceed without the boilerplate.

module TickingPort where

import Signal
import Signal ((<~), Signal)

import Time

import Text
import Graphics.Element (Element)
main : Element
main = Text.asText "main"

port messageOut : Signal String
port messageOut = Signal.map toString (Time.every Time.second)

Next, wire import your module into Node!

var path = require("path");
var Elm = require("elm-loader");

var compiledCode = Elm(path.resolve(__dirname, "ticking_port.elm"), __dirname);

compiledCode.emitter.on("messageOut", function(message) {
  console.log(message)
});

Watch it tick!

$ node test.js
1418683956865
1418683957870
1418683958873
1418683959874
1418683960875
^C

You can also access the ports property, rather than the emitter on the object returned by the top level factory function and subscribe as you would with a typical setup.

Caveats

The loader supports conventional CamelCase filenames for the Elm modules they contain. If you prefer to split thw words in your filenames with underscores, they will automatically be inflected to infer the module they contain, e.g. ticking_port.elm will correspond to the TickingPort module above.

If you are defining ports into Elm, you also need to supply a second argument to the factory function to define the defaults for those functions, e.g.

var echoPort = Elm(path.resolve(__dirname, "fixtures/echo_port.elm"), "fixtures", {
  messageIn: ""
});

Example

To try it out, clone this repository, run npm link and then run node example/test.js!