SlideShare une entreprise Scribd logo
1  sur  17
Clojure on Node
Building a CLI utility
Why?
• Startup speed - Node.js apps start faster
• Easier distribution -- ```npm install -g <app>```
• Way to learn core.async
• AWS Lambda/Google Cloud Functions
(serverless architecture)
• Server-side rendering
ClojureScript build process
*.cljs files *.js file(s)
Google Closure
compiler
ClojureScript
compiler
compiles
cljs->js
compiles
js->optimized-js
Setting up Leiningen
Setting up Leinigen (cont'd)
Hello, World!
Building
Read Eval Print Loop demo
REPL
starts
nodejs process on random port
does this:
and sends user commands to nodejs process, started by
repl-env, over the network socket
used by IDEs
Parsing ars - clj.tools.cli
Parsing args (cont'd)
Interop with Node.js libraries
compiles into
Callbacks
core.async for callbacks
georgewsinger/cljs-callback-heaven/blob/master/src/cljs_callback
core.async for callbacks
(cont'd)
https://github.com/mailhog/MailHog
core.async for promises
Links
• clojars.org/<template-name>/lein-template
=>
```lein new <template-name> <project-name>```
• https://clojars.org/cljs-node/lein-template
• https://clojars.org/cljs-node-app/lein-template
• https://clojars.org/node-cljs/lein-template
• https://clojars.org/node-cli/lein-template
• https://github.com/karolisl/repomaker -- my cljs-node project
• https://github.com/Gozala/node.core -- some helper functions working on node
• https://github.com/GregorStocks/cljs-http-node -- core.async based http client for
node

Contenu connexe

Tendances

Ansible
AnsibleAnsible
Ansible
gnosek
 

Tendances (20)

TensorFlow, Docker & GoLang - All for Image Rekognition Sangam Biradar(Engine...
TensorFlow, Docker & GoLang - All for Image Rekognition Sangam Biradar(Engine...TensorFlow, Docker & GoLang - All for Image Rekognition Sangam Biradar(Engine...
TensorFlow, Docker & GoLang - All for Image Rekognition Sangam Biradar(Engine...
 
Understand How Node.js and Core Features Works
Understand How Node.js and Core Features WorksUnderstand How Node.js and Core Features Works
Understand How Node.js and Core Features Works
 
Basics of Node.js
Basics of Node.jsBasics of Node.js
Basics of Node.js
 
Cloud Native Okteto Cloud
Cloud Native Okteto Cloud Cloud Native Okteto Cloud
Cloud Native Okteto Cloud
 
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
 
SQL Sever on Docker: Database Containers 3 Ways
SQL Sever on Docker: Database Containers 3 WaysSQL Sever on Docker: Database Containers 3 Ways
SQL Sever on Docker: Database Containers 3 Ways
 
Continous Delivery to Kubernetes using Helm
Continous Delivery to Kubernetes using HelmContinous Delivery to Kubernetes using Helm
Continous Delivery to Kubernetes using Helm
 
Ansible
AnsibleAnsible
Ansible
 
CI/CD Pipeline with Octopus Deploy
CI/CD Pipeline with Octopus DeployCI/CD Pipeline with Octopus Deploy
CI/CD Pipeline with Octopus Deploy
 
Run C++ as serverless with GCP Cloud Functions
Run C++ as serverless with GCP Cloud FunctionsRun C++ as serverless with GCP Cloud Functions
Run C++ as serverless with GCP Cloud Functions
 
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработки
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработкиJS Fest 2018. Алексей Волков. Полезные инструменты для JS разработки
JS Fest 2018. Алексей Волков. Полезные инструменты для JS разработки
 
Building a deployment pipeline
Building a deployment pipelineBuilding a deployment pipeline
Building a deployment pipeline
 
Lando - AddWeb Solution
Lando - AddWeb Solution Lando - AddWeb Solution
Lando - AddWeb Solution
 
CI CD WORKFLOW
CI CD WORKFLOWCI CD WORKFLOW
CI CD WORKFLOW
 
Docker slaves
Docker slavesDocker slaves
Docker slaves
 
Node.js in a heterogeneous system
Node.js in a heterogeneous systemNode.js in a heterogeneous system
Node.js in a heterogeneous system
 
Building CI/CD Pipelines for Kubernetes
Building CI/CD Pipelines for KubernetesBuilding CI/CD Pipelines for Kubernetes
Building CI/CD Pipelines for Kubernetes
 
Dockerizing Rails
Dockerizing RailsDockerizing Rails
Dockerizing Rails
 
Puppet Camp Berlin 2015: Andrea Giardini | Configuration Management @ CERN: G...
Puppet Camp Berlin 2015: Andrea Giardini | Configuration Management @ CERN: G...Puppet Camp Berlin 2015: Andrea Giardini | Configuration Management @ CERN: G...
Puppet Camp Berlin 2015: Andrea Giardini | Configuration Management @ CERN: G...
 
Docker as development environment
Docker as development environmentDocker as development environment
Docker as development environment
 

En vedette

Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
elliando dias
 
Apache Solr crash course
Apache Solr crash courseApache Solr crash course
Apache Solr crash course
Tommaso Teofili
 

En vedette (20)

Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Clojure - Why does it matter?
Clojure - Why does it matter?Clojure - Why does it matter?
Clojure - Why does it matter?
 
Some basic FP concepts
Some basic FP conceptsSome basic FP concepts
Some basic FP concepts
 
Clojure+ClojureScript Webapps
Clojure+ClojureScript WebappsClojure+ClojureScript Webapps
Clojure+ClojureScript Webapps
 
ClojureScript Introduction
ClojureScript IntroductionClojureScript Introduction
ClojureScript Introduction
 
Making design decisions in React-based ClojureScript web applications
Making design decisions in React-based ClojureScript web applicationsMaking design decisions in React-based ClojureScript web applications
Making design decisions in React-based ClojureScript web applications
 
Learn basics of Clojure/script and Reagent
Learn basics of Clojure/script and ReagentLearn basics of Clojure/script and Reagent
Learn basics of Clojure/script and Reagent
 
An Adventure in Serverless ClojureScript
An Adventure in Serverless ClojureScriptAn Adventure in Serverless ClojureScript
An Adventure in Serverless ClojureScript
 
ClojureScript - A functional Lisp for the browser
ClojureScript - A functional Lisp for the browserClojureScript - A functional Lisp for the browser
ClojureScript - A functional Lisp for the browser
 
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.
 
All for Web development
All for Web developmentAll for Web development
All for Web development
 
Building a Large Scale SEO/SEM Application with Apache Solr: Presented by Rah...
Building a Large Scale SEO/SEM Application with Apache Solr: Presented by Rah...Building a Large Scale SEO/SEM Application with Apache Solr: Presented by Rah...
Building a Large Scale SEO/SEM Application with Apache Solr: Presented by Rah...
 
Ruby language overview
Ruby language overviewRuby language overview
Ruby language overview
 
Ruby is Awesome and Rust is Awesome and Building a Game in Both is AWESOME
Ruby is Awesome and Rust is Awesome and Building a Game in Both is AWESOMERuby is Awesome and Rust is Awesome and Building a Game in Both is AWESOME
Ruby is Awesome and Rust is Awesome and Building a Game in Both is AWESOME
 
Node.js'e Hızlı Bir Bakış
Node.js'e Hızlı Bir BakışNode.js'e Hızlı Bir Bakış
Node.js'e Hızlı Bir Bakış
 
From Java To Clojure (English version)
From Java To Clojure (English version)From Java To Clojure (English version)
From Java To Clojure (English version)
 
The road to php 7.1
The road to php 7.1The road to php 7.1
The road to php 7.1
 
Fullstack End-to-end test automation with Node.js, one year later
Fullstack End-to-end test automation with Node.js, one year laterFullstack End-to-end test automation with Node.js, one year later
Fullstack End-to-end test automation with Node.js, one year later
 
Apache Solr crash course
Apache Solr crash courseApache Solr crash course
Apache Solr crash course
 

Similaire à CLI utility in ClojureScript running on Node.js

Similaire à CLI utility in ClojureScript running on Node.js (20)

Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.com
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
 
Nodejs
NodejsNodejs
Nodejs
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
DevEx | there’s no place like k3s
DevEx | there’s no place like k3sDevEx | there’s no place like k3s
DevEx | there’s no place like k3s
 
Cypress for Testing
Cypress for TestingCypress for Testing
Cypress for Testing
 
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...Orchestration tool roundup   kubernetes vs. docker vs. heat vs. terra form vs...
Orchestration tool roundup kubernetes vs. docker vs. heat vs. terra form vs...
 
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...
Uri Cohen & Dan Kilman, GigaSpaces - Orchestration Tool Roundup - OpenStack l...
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed Assaf
 
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...Orchestration tool roundup  - OpenStack Israel summit - kubernetes vs. docker...
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Node js
Node jsNode js
Node js
 
Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10Halton Software Peer 2 Peer Meetup #10
Halton Software Peer 2 Peer Meetup #10
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Angular on ASP.NET MVC 6
Angular on ASP.NET MVC 6Angular on ASP.NET MVC 6
Angular on ASP.NET MVC 6
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

CLI utility in ClojureScript running on Node.js

Notes de l'éditeur

  1. (println #(println "a"))
  2. ; this will implicitly set! *cljs-compiler-env* (set! *cljs-repl-env* repl-env) Code for node-repl is javascript inside clojurescript jar, uses net.createServer() (println #(println "a"))