https://github.com/degree9/boot-nodejs
Node.js wrapper task for boot-clj
https://github.com/degree9/boot-nodejs
boot-clj boot-exec boot-nodejs nodejs
Last synced: 2 months ago
JSON representation
Node.js wrapper task for boot-clj
- Host: GitHub
- URL: https://github.com/degree9/boot-nodejs
- Owner: degree9
- License: mit
- Created: 2016-08-10T18:39:44.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T01:02:16.000Z (almost 5 years ago)
- Last Synced: 2025-04-03T11:11:37.804Z (3 months ago)
- Topics: boot-clj, boot-exec, boot-nodejs, nodejs
- Language: Clojure
- Size: 105 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://clojars.org/degree9/boot-nodejs)
[](https://jarkeeper.com/degree9/boot-nodejs)
[](https://jarkeeper.com/degree9/boot-nodejs)
[![Slack][slack]][d9-slack]Node.js wrapper task for [boot-clj][1].
---
![]()
boot-nodejs is developed and maintained by Degree9---
* Provides `nodejs` task for generating node.js entrypoint.
* Provides `serve` task for executing node.js server.> The following outlines basic usage of the task, extensive testing has not been done.
> Please submit issues and pull requests!## Usage ##
Add `boot-nodejs` to your `build.boot` dependencies and `require` the namespace:
```clj
(set-env! :dependencies '[[degree9/boot-nodejs "X.Y.Z"]])
(require '[degree9.boot-nodejs :refer :all])
```Generate a node.js cljs edn file.
```bash
boot nodejs -i app.server/init -e nodejs
```Start a node.js server script.
```bash
boot serve -s nodejs
```Use in a wrapper task:
```clojure
(boot/deftask start-server
"Start app server."
[...]
(let [...]
(comp
(nodejs :init-fn 'app.server/init)
(serve))))
```## Task Options ##
The `nodejs` task exposes options for generating a node.js compatible .cljs.edn file.
```clojure
e edn VAL str "Node.js main edn name. (nodejs)"
i init-fn VAL sym "Node.js init function."
d develop bool "Sets nodejs-cljs dev flag."
```By default the `nodejs` task will produce a `nodejs.cljs.edn` file.
The `serve` task exposes options for starting a Node.js instance.
```clojure
s script VAL str "Node.js main script file. (nodejs)"
```If you use a custom `:edn` name for `nodejs` task, that name can be used for the `:script` option of the `serve` task.
---
![]()
Support this and other open-source projects on Patreon!---
[1]: https://github.com/boot-clj/boot
[slack]: https://img.shields.io/badge/clojurians-degree9-%23e01563.svg?logo=slack
[d9-slack]: https://clojurians.slack.com/channels/degree9/