Skip to content

Instantly share code, notes, and snippets.

@mstump
Created June 4, 2012 20:53
Show Gist options
  • Save mstump/2870806 to your computer and use it in GitHub Desktop.
Save mstump/2870806 to your computer and use it in GitHub Desktop.
cljsc src '{:optimizations :simple :pretty-print true :target :nodejs}' > lib/sample.js
var sample = require("./sample.js")
exports.core = sample.sample.core
$ node lib/sample.js
blargl!
{
"name": "sample",
"preferGlobal": false,
"version": "0.9.0",
"author": "SourceNinja <[email protected]> (http://www.sourceninja.com/)",
"description": "a simple sample Node.js application",
"contributors": [
"Matt Stump <mstump -at- sourceninja.com>"
],
"repository": {
"type": "git",
"url": "git://github.com/SourceNinja/simple-node-sample.git"
},
"license": "AGPL",
"dependencies": {
"npm": ">= 1.1.2"
},
"devDependencies": {},
"optionalDependencies": {},
"engines": {
"node": "0.6 || 0.7 || 0.8"
},
"homepage": "https://github.com/sourceninja/simple-node-sample",
"main": "lib/main.js"
}
(ns sample.core
(:require [cljs.nodejs :as node]))
(defn blargl
[]
(println "blargl!"))
(ns sample.core
(:require [cljs.nodejs :as node]))
(defn blargl
[]
(println "blargl!"))
(set! *main-cli-fn* blargl)
(ns sample.core
(:require [cljs.nodejs :as node]))
(defn blargl
[]
(println "blargl!"))
(defn noop [] nil)
(set! *main-cli-fn* noop)
(defn make-js-map
"makes a javascript map from a clojure one"
[cljmap]
(let [out (js-obj)]
(doall (map #(aset out (name (first %)) (second %)) cljmap))
out))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment