Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on JavaScript.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/js.e>
#           or at <http://angg.twu.net/e/js.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.eloquent-js»		(to "eloquent-js")
# «.nodejs-docs»		(to "nodejs-docs")
# «.nodejs-from-git»		(to "nodejs-from-git")
# «.nodejs-bullseye»		(to "nodejs-bullseye")
# «.node-canvas»		(to "node-canvas")
# «.node_modules»		(to "node_modules")
# «.elk»			(to "elk")
# «.quickjs»			(to "quickjs")
# «.D3.js»			(to "D3.js")
# «.indium»			(to "indium")
# «.lsystem»			(to "lsystem")
# «.svelte»			(to "svelte")
# «.plotly»			(to "plotly")
# «.skewer-mode»		(to "skewer-mode")




#####
#
# eloquent-js
# 2024feb22
#
#####

# «eloquent-js»  (to ".eloquent-js")
# (find-fline "~/LOGS/2024feb22/javascript2" "Eloquent JavaScript")

;; <eloquentjs>
;; https://eloquentjavascript.net/
;; https://eloquentjavascript.net/Eloquent_JavaScript.pdf
(code-pdf-page "eloquentjs" "$S/https/eloquentjavascript.net/Eloquent_JavaScript.pdf")
(code-pdf-text "eloquentjs" "$S/https/eloquentjavascript.net/Eloquent_JavaScript.pdf" 12)
;; (find-eloquentjspage)
;; (find-eloquentjstext)
;; (find-eloquentjspage 4 "Contents")
;; (find-eloquentjstext 4 "Contents")
;; (find-eloquentjspage (+ 12 410) "Index")
;; (find-eloquentjstext (+ 12 410) "Index")
;; (find-eloquentjspage (+ 12 430) "require function, 171, 172, 179, 352," "354, 363, 374")
;; (find-eloquentjstext (+ 12 430) "require function, 171, 172, 179, 352," "354, 363, 374")


require:
;; (find-eloquentjspage (+ 12 171) "")
;; (find-eloquentjstext (+ 12 171) "")
;; (find-eloquentjspage (+ 12 172) "")
;; (find-eloquentjstext (+ 12 172) "")
;; (find-eloquentjspage (+ 12 179) "")
;; (find-eloquentjstext (+ 12 179) "")
;; (find-eloquentjspage (+ 12 352) "")
;; (find-eloquentjstext (+ 12 352) "")
;; (find-eloquentjspage (+ 12 354) "")
;; (find-eloquentjstext (+ 12 354) "")
;; (find-eloquentjspage (+ 12 363) "")
;; (find-eloquentjstext (+ 12 363) "")
;; (find-eloquentjspage (+ 12 374) "")
;; (find-eloquentjstext (+ 12 374) "")


;; (find-eloquentjstext (+ 12 430) "require function, 171, 172, 179, 352," "354, 363, 374")





#####
#
# nodejs-docs
# 2024feb22
#
#####

# «nodejs-docs»  (to ".nodejs-docs")
# (find-angg ".emacs" "ee-rstdoc-:nodejs")

# (find-status   "nodejs-doc")
# (find-vldifile "nodejs-doc.list")
# (find-udfile   "nodejs-doc/")
# file:///usr/share/doc/nodejs/api/index.html
# (find-nodejsdoc)
# (find-nodejsdoc "fs#fspromisesaccesspath-mode")
# (find-nodejsdoc "modules#requireid")
# (find-nodejsdoc "modules#modules_require_id")



#####
#
# nodejs-from-git
# 2024feb22
#
#####

# «nodejs-from-git»  (to ".nodejs-from-git")
# (find-git-links "https://github.com/nodejs/node" "nodejssrc")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# rm -Rfv ~/bigsrc/node/
cd      ~/bigsrc/
git clone https://github.com/nodejs/node
cd      ~/bigsrc/node/

# (find-fline "~/bigsrc/")
# (find-fline "~/bigsrc/node/")
# (find-gitk  "~/bigsrc/node/")

# (code-c-d "nodejssrc" "~/bigsrc/node/")
# (find-nodejssrcfile "")
# (find-nodejssrcsh "find * | sort")
# (find-nodejssrcsh "cat .files | grep '\\.c'$")
# (find-nodejssrcsh "cat .files | grep '\\.cpp'$")

cd ~/bigsrc/node/
find * | sort > .files
find * | sort | grep '\.c$'   > .files.c
find * | sort | grep '\.cpp$' > .files.cpp
find * | sort | grep require | grep js | tee .files.requirejs

# (find-nodejssrcgrep "grep --color=auto -nH --null -e 'const require' $(cat .files.requirejs)")
# (find-nodejssrcfile "test/es-module/test-esm-require-cache.mjs")
# (find-nodejssrcfile "lib/internal/modules/helpers.js")
# (find-nodejssrcfile "lib/internal/modules/helpers.js" "function makeRequireFunction")
# (find-fline "~/LOGS/2024feb22/javascript2" "modules/helpers.js")




#####
#
# nodejs-bullseye
# 2021sep07
#
#####

# «nodejs-bullseye»  (to ".nodejs-bullseye")
# https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-debian-10
# https://linuxize.com/post/how-to-install-node-js-on-debian-10/
# (find-sh "apt-cache search 'node-js*' | sort")
# (find-sh "apt-cache search 'nodejs*'  | sort")
# (find-sh "apt-cache search 'node*'    | sort")
# (find-sh "apt-cache search 'npm*'     | sort")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
apti nodejs nodejs-doc npm

# (find-status   "nodejs")
# (find-vldifile "nodejs.list")
# (find-udfile   "nodejs/")
# (find-status   "nodejs-doc")
# (find-vldifile "nodejs-doc.list")
# (find-udfile   "nodejs-doc/")

npm install canvas

# (find-man "1 node")
# (find-man "1 nodejs")
# (find-angg "JS/test1.js")




#####
#
# node-canvas
# 2021sep07
#
#####

# «node-canvas»  (to ".node-canvas")
# (find-angg "JS/canvas1.js")

# https://sebhastian.com/node-canvas/
# https://github.com/Automattic/node-canvas
# (find-git-links "https://github.com/Automattic/node-canvas" "nodecanvas")
# (code-c-d "nodecanvas" "~/usrc/node-canvas/")
# (find-nodecanvasfile "")
# (find-nodecanvasfile "examples/images/")
# (find-fline "~/usrc/node-canvas/examples/images/")

cp -v ~/usrc/node-canvas/examples/images/lime-cat.jpg ~/JS/examples/images/
# (find-fline "~/JS/canvas1.js")





#####
#
# The node_modules directory
# 2021sep08
#
#####

# «node_modules»  (to ".node_modules")
# (find-fline "~/JS/node_modules/")
# (find-fline "~/JS/node_modules/" "is-fullwidth-code-point")

node-string-width: /usr/share/nodejs/string-width/node_modules/is-fullwidth-code-point/index.d.ts
node-string-width: /usr/share/nodejs/string-width/node_modules/is-fullwidth-code-point/index.js
node-string-width: /usr/share/nodejs/string-width/node_modules/is-fullwidth-code-point/package.json
npm: /usr/share/nodejs/npm/node_modules/is-fullwidth-code-point/index.js
npm: /usr/share/nodejs/npm/node_modules/is-fullwidth-code-point/package.json




#####
#
# Elk: a tiny JS engine for embedded systems
# 2021sep24
#
#####

# «elk»  (to ".elk")
# https://news.ycombinator.com/item?id=28614092 Elk: A low footprint JavaScript engine for embedded systems (github.com/cesanta)
# https://github.com/cesanta/elk
# https://github.com/cesanta/elk/blob/master/elk.c



#####
#
# Fabrice Bellard's QuickJS Javascript Engine
# 2021sep24
#
#####

# «quickjs»  (to ".quickjs")
# https://bellard.org/quickjs/
# https://github.com/bellard/quickjs
# (find-git-links "https://github.com/bellard/quickjs" "quickjs")
# (code-c-d "quickjs" "~/usrc/quickjs/")
# (find-quickjsfile "")
# (find-quickjsfile "Makefile")
# (find-quickjsfile "readme.txt")
# (find-quickjsfile "doc/")
# (find-quickjsfile "examples/")
# (find-quickjsfile "om")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# rm -Rfv ~/usrc/quickjs/
cd      ~/usrc/
git clone https://github.com/bellard/quickjs
cd      ~/usrc/quickjs/

make            |& tee om
make build_doc  |& tee ombd



#####
#
# D3.js
# 2021dec11
#
#####

# «D3.js»  (to ".D3.js")
# https://d3js.org/
https://www.youtube.com/watch?v=_8V5o2UHG0E



#####
#
# indium
# 2022jan23
#
#####

# «indium»  (to ".indium")
# (find-epackage-links 'indium "indium" t)
# (find-epackage-links 'indium)




#####
#
# L-System Explorer (by ankava)
# 2023may13
#
#####

# «lsystem»  (to ".lsystem")
# https://news.ycombinator.com/item?id=32079041 L-System Explorer (anvaka.github.io)
# https://news.ycombinator.com/from?site=anvaka.github.io
# (find-git-links "https://github.com/anvaka/lsystem" "lsystem")
# (code-c-d "lsystem" "~/usrc/lsystem/")
# (find-lsystemfile "")
# (find-lsystemfile "README.md")
# (find-lsystemfile "README.md" "npm install")




#####
#
# svelte
# 2023may24
#
#####

# «svelte»  (to ".svelte")
# (find-telegachat "1487862914#218539" "https://svelte.dev")
# https://svelte.dev
# https://svelte.dev/tutorial/basics
# https://svelte.dev/docs#getting-started

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/tmp/sv/")
rm -Rv /tmp/sv/
mkdir  /tmp/sv/
cd     /tmp/sv/
npm create svelte@latest myapp
cd myapp
npm install
npm run dev

/home/edrx/e(edrx:sc)# rm -Rv /tmp/sv/
/home/edrx/e(edrx:sc)# mkdir  /tmp/sv/
/home/edrx/e(edrx:sc)# cd     /tmp/sv/
/tmp/sv(edrx:sc)# npm create svelte@latest myapp
npm ERR! code EAI_AGAIN
npm ERR! syscall getaddrinfo
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/create-svelte failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/edrx/.npm/_logs/2023-05-25T00_54_36_486Z-debug.log
/tmp/sv(edrx:sc)# 

# (find-fline "~/.npm/_logs/2023-05-25T00_54_36_486Z-debug.log")



#####
#
# plotly
# 2023nov04
#
#####

# «plotly»  (to ".plotly")
# https://plotly.com/javascript/
# https://plotly.com/javascript/getting-started/



#####
#
# skewer-mode
# 2024mar30
#
#####

# «skewer-mode»  (to ".skewer-mode")
# (find-fline "~/LOGS/2024mar29.emacs" "so skewer-mode is quite decent")
# https://github.com/skeeto/skewer-mode
# https://paste.mozilla.org/K6KRWyeg#L2

(use-package skewer-mode :ensure t :pin melpa
  ;; <https://github.com/skeeto/skewer-mode>
  :unless noninteractive
  :defer t
  :commands (run-skewer) ;; main entrypoint
  :init
  (defalias 'skewer-start #'run-skewer)
  :config
  (defun skewer-stop ()
    "Stop a skewer JavaScript REPL."
    (interactive)
    (skewer-eval "window.close();")
    (httpd-stop)
    ;; kill stragglers, if any
    (mapc #'delete-process
          (seq-filter (lambda (x)
                        (string-match (rx (or "httpd"
                                              "httpd <127.0.0.1"))
                                      x))
                      (mapcar #'process-name (process-list)))))
  ;; add hooks for js2, css, html
  (skewer-setup)
  ;; skewer-mode needs us to use `js2-mode'
  (push '("\\.js[mx]?\\'" . js2-mode) auto-mode-alist)
  (message "If HTML/CSS/JS files already open, revert them via \"C-x x g\""))







https://stackoverflow.com/questions/25897951/is-there-any-standlone-gui-module-for-node-application?fbclid=IwAR0p4yIk8KX8iYO4CFVyzStKrMikJW8n2tgEYsFcf2fYSCoIM4mjycuP9GE

https://deskgap.com/
https://www.npmjs.com/package/deskgap
https://jaxenter.com/deskgap-cross-platform-apps-155615.html
https://www.saashub.com/compare-neutralinojs-vs-deskgap

https://news.ycombinator.com/item?id=28797535 Xterm.js (xtermjs.org)

https://jpmens.net/2016/03/05/a-shell-command-to-create-json-jo/





Notes by Cypher:

;; TODO
;; P5.js
;; library
;; there is ap5* editor as well...
;; programming for musicians and artists

;; getting started with WEBGL
;; https://riptutorial.com/webgl/example/8648/installation-or-setup

;; sudo npm install -g http-server
;; http-server
;; then open the URL address and load the html file

;; Using p5js with org-mode in emacs
;; https://alejandrogallo.github.io/blog/posts/ob-p5js/

;; The Coding Train channel
;; https://yewtu.be/channel/UCvjgXvBlbQiydffZU7m1_aw

;; 1.1. Introduction - p5.js Tutorial
;; https://yewtu.be/watch?v=8j0UDiN7my4
;; https://yewtu.be/watch?v=yPWkPOfnGsw&listen=false

;; Watch the videos:
;; p5.js Web Editor with Cassie Tarakajian
;; Acesssibility in the p5.js Web Editor with Mathura Govindarajan
;; p5.js for educators with Saber Khan 
;; Luisa Pereira
;; https://www.luisapereira.net/info.html

;; See these other beginner's languages
;; See pyret
;; See Racket language 
;; See javaScript p5.js

;; you need to download the library to use the book Manual
;; gitc https://github.com/processing/p5.js

https://dev.to/geoffreycopin/build-a-custom-javascript-linter-in-5-minutes-4a1j
https://www.gibney.org/bookmarklet_editor

https://kaleidawave.github.io/posts/ezno-23/
https://blog.orhun.dev/packaging-rust-for-npm/

https://git.sr.ht/~fitzsim/firefox-javascript-repl/tree/main/item/firefox-javascript-repl.el
https://lists.gnu.org/archive/html/emacs-devel/2023-05/msg00629.html [ELPA] New package: firefox-javascript-repl
https://boajs.dev/posts/2023-07-08-boa-release-17/

https://strudel.tidalcycles.org/
https://jvns.ca/blog/2017/06/26/vue-js-fun/

https://pong-wars.koenvangilst.nl/
https://github.com/vnglst/pong-wars
https://github.com/vnglst/pong-wars/blob/main/index.html

https://github.com/google/zx
https://news.ycombinator.com/item?id=39323986 ZX – A tool for writing better scripts (github.com/google)


https://devdocs.io/javascript/

https://esoteric.codes/blog/calculating-with-jss-undefined





#  Local Variables:
#  coding:               utf-8-unix
#  End: