No description
Find a file
jasmine 506821f638
Add interactive REPL with helpers and improve package management
- Add Node.js to devshell for mature, stable REPL
- Create .replrc.js with println() and dir() helpers
- Add 'just repl' command with auto-loaded helpers
- Add 'just add-dev' and 'just remove' for package management
- Update README with complete command reference and feature list
2025-10-28 00:45:57 +08:00
nix/modules Add interactive REPL with helpers and improve package management 2025-10-28 00:45:57 +08:00
src Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
.envrc Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
.gitignore Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
.prettierignore Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
.replrc.js Add interactive REPL with helpers and improve package management 2025-10-28 00:45:57 +08:00
bun.lockb Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
eslint.config.js Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
flake.lock Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
flake.nix Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
index.html Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
Justfile Add interactive REPL with helpers and improve package management 2025-10-28 00:45:57 +08:00
LICENSE Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
package.json Initial commit: minimal JavaScript template with Nix 2025-10-27 21:24:12 +08:00
README.md Add interactive REPL with helpers and improve package management 2025-10-28 00:45:57 +08:00

JavaScript Template

A minimal JavaScript development template using Nix. Key features:

  • Nix + Flakes for reproducible environments
  • Bun (fast JavaScript runtime & package manager)
  • Vite (development server & build tool)
  • Node.js (mature REPL with custom helpers)
  • ESLint + Prettier (linting & formatting)
  • Devshell commands via just

Prerequisites

  • Nix with flakes enabled
  • direnv (optional but recommended)

Getting Started

Initialize a new project using omnix:

nix run nixpkgs#omnix -- \
  init github:sajenim/javascript-template -o ./my-project

Then enter the development environment:

cd my-project
direnv allow  # Or use: nix develop
just dev

NixOS users: If bun-installed binaries fail to find system libraries, enable FHS compatibility:

# nix/modules/devshell.nix
fhs = true;

Available Commands

Run just to see all available commands:

just dev       # Start dev server
just repl      # Node.js REPL with helpers
just lint      # Lint with ESLint
just format    # Format with Prettier
just build     # Production build
just clean     # Clean build artifacts
just update    # Update flake inputs
just upgrade   # Upgrade bun packages

Customization

This template provides minimal, sensible defaults. Customize as needed:

  • Modify linting rules in eslint.config.js
  • Add Prettier config via .prettierrc if needed
  • Extend Justfile with project-specific commands
  • Add custom REPL helpers in .replrc.js

Acknowledgments