codepunk v1.0.6
CodePunk
CodePunk is a cyberpunk themed JavaScript notebook inspired by Stephen Grider's jsnote. It is almost like jupyter notebook but it runs JavaScript. CodePunk client can directly run NodeJS environment code in the browser.
This repository is command line interface for CodePunk package which connects rest of the packages - local server and the client.
Usage
Install (globally)
npm install -g codepunk
Start Local Server
codepunk serve
This runs the local server at port 4005 (default) which serves the local client.
Note: file 'notebook.js' will be created at the current working directory of your terminal with some default cells.
Options
Open a specific notebook. (file path is relative)
Note: Notebooks are saved in a .js file
codepunk serve mynote.js
Start server on a different port
codepunk serve mynote.js --port 4040
Client
Visit http://localhost:port (replace 'port' with port number e.g 4005) to view the codepunk client in the browser.
Features
Preview
Preview data, object and jsx with special display function in the preview window. Any DOM manipulation or React App will be visible in the preview window as well.
Format Code
Prettier is used behind the scene to format the code.
Directly import and use packages
Packages are fetched from unpkg then bundled and transpiled with esbuild to run in browser. Imported packages are cached for performance.
Share the notebook
CodePunk notebooks are saved in a .js file. You can share it and other will be about to use it in their own local client.