https://github.com/hiteshjasani/cljs-node-utils
https://github.com/hiteshjasani/cljs-node-utils
library wip
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hiteshjasani/cljs-node-utils
- Owner: hiteshjasani
- License: epl-1.0
- Created: 2018-03-15T17:39:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-24T01:01:28.000Z (over 8 years ago)
- Last Synced: 2024-11-30T13:18:09.036Z (over 1 year ago)
- Topics: library, wip
- Language: Clojure
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cljs-node-utils
[](https://clojars.org/org.jasani/cnu)
A Clojure library of utilities for working with Node.js
Note: this is an early release and the api may change drastically.
## Usage
```clojure
(:require [cnu.interop :refer [jsobj->edn])
;; wherever we need to convert a javascript object into edn
(jsobj->edn (clj->js {:foo "bar"}))
;;=> {:foo "bar"}
(jsobj->edn (clj->js {:foo "bar"}) false)
;;=> {"foo" "bar"}
;; or arbitrary json to edn
(json->edn (clj->js {:foo "bar"}))
;;=> {:foo "bar"}
(json->edn (clj->js {:foo "bar"}) false)
;;=> {"foo" "bar"}
```
### In lumo
```shell
% lumo -D org.jasani/cnu:0.1.0 myscript.cljs
```
Note that lumo doesn't download clojars dependencies. They must
already be in your local maven repo to use them.
## License
Copyright © 2018 Hitesh Jasani
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.