Created
June 4, 2012 20:53
-
-
Save mstump/2870806 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cljsc src '{:optimizations :simple :pretty-print true :target :nodejs}' > lib/sample.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sample = require("./sample.js") | |
exports.core = sample.sample.core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node lib/sample.js | |
blargl! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns sample.core | |
(:require [cljs.nodejs :as node])) | |
(defn blargl | |
[] | |
(println "blargl!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns sample.core | |
(:require [cljs.nodejs :as node])) | |
(defn blargl | |
[] | |
(println "blargl!")) | |
(set! *main-cli-fn* blargl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns sample.core | |
(:require [cljs.nodejs :as node])) | |
(defn blargl | |
[] | |
(println "blargl!")) | |
(defn noop [] nil) | |
(set! *main-cli-fn* noop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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