All Projects → weavejester → Ns Tracker

weavejester / Ns Tracker

Licence: epl-1.0
Library to keep track of changes to Clojure source files

Programming Languages

clojure
4091 projects
ring
36 projects

Labels

Projects that are alternatives of or similar to Ns Tracker

I8086.js
16bit Intel 8086 / 80186 + X87 emulator written in TypeScript with REPL assembly compiler and tiny C compiler
Stars: ✭ 54 (-43.16%)
Mutual labels:  repl
Ramtuary
Ramda + Ramda Fantasy + Sanctuary REPL 🌿
Stars: ✭ 72 (-24.21%)
Mutual labels:  repl
Clj Suitable
ClojureScript "IntelliSense" support for JS objects and their properties/methods. Via figwheel and Emacs CIDER.
Stars: ✭ 82 (-13.68%)
Mutual labels:  repl
Trymodule
➰ It's never been easier to try nodejs modules!
Stars: ✭ 1,115 (+1073.68%)
Mutual labels:  repl
Repl
🐚 an instant REPL for any command
Stars: ✭ 71 (-25.26%)
Mutual labels:  repl
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (-21.05%)
Mutual labels:  repl
Nclap
NClap is a .NET library for parsing command-line arguments and building interactive command shells. It's driven by a declarative attribute syntax, and easy to extend.
Stars: ✭ 51 (-46.32%)
Mutual labels:  repl
Evaluate
A version of eval for R that returns more information about what happened
Stars: ✭ 88 (-7.37%)
Mutual labels:  repl
Akilang
A compiler for a simple language, built with Python and LLVM
Stars: ✭ 71 (-25.26%)
Mutual labels:  repl
Omnia
Stars: ✭ 81 (-14.74%)
Mutual labels:  repl
Flask Konch
An improved shell command for the Flask CLI
Stars: ✭ 65 (-31.58%)
Mutual labels:  repl
Drepl
A REPL for D
Stars: ✭ 70 (-26.32%)
Mutual labels:  repl
Ultra
A Leiningen plugin for a superior development environment
Stars: ✭ 1,213 (+1176.84%)
Mutual labels:  repl
Baapan
✨ Super Cool NPM Playground right on the Node REPL ✨
Stars: ✭ 60 (-36.84%)
Mutual labels:  repl
Psysh
A REPL for PHP
Stars: ✭ 9,161 (+9543.16%)
Mutual labels:  repl
Ronin
Experimental Graphics Terminal
Stars: ✭ 1,065 (+1021.05%)
Mutual labels:  repl
Boot Cljs Repl
Boot task providing a REPL for ClojureScript development.
Stars: ✭ 74 (-22.11%)
Mutual labels:  repl
Rusti
REPL for the Rust programming language
Stars: ✭ 1,316 (+1285.26%)
Mutual labels:  repl
Kubeplay
kubeplay – a new way to interact with Kubernetes API from your terminal
Stars: ✭ 83 (-12.63%)
Mutual labels:  repl
Goto
Goto is an interpreted programming language written in go.
Stars: ✭ 79 (-16.84%)
Mutual labels:  repl

ns-tracker

Build Status

ns-tracker is a Clojure library for keeping track of changes to source files and their associated namespaces. This is usually used to automatically reload modified namespaces in a running Clojure application.

It is derived from code in Stuart Sierra's Lazytest tool, and the credit for writing the vast majority of the code used in this library should therefore go to him.

Installation

As usual, to use this library, add the following dependency to your project.clj file:

[ns-tracker "0.4.0"]

Usage

Use the ns-tracker.core/ns-tracker function to create a new tracker function for one or more source directories:

(use 'ns-tracker.core)

(def modified-namespaces
  (ns-tracker ["src" "test"]))

When you call the modified-namespaces function, it will return a list of Clojure namespaces that have changed. You can then reload them on the fly:

(doseq [ns-sym (modified-namespaces)]
  (require ns-sym :reload))

This can be placed in a background thread, or triggered by some user request.

Declaring Dependencies to Static Resources

Some Clojure libraries, such as HugSQL, define functions in a namespace based on the content of a static resource file. ns-tracker is able to reload such a namespace when the resource file is modified with the help of a bit metadata.

You will need to declare the resources under the :ns-tracker/resource-deps key in the namespace's metadata:

(ns example.db
  {:ns-tracker/resource-deps ["sql/queries.sql"]}
  (:require example.utils))    

The resource path needs to be relative to one of the source directories which you gave as a parameter to the ns-tracker.core/ns-tracker function.

License

Copyright © 2019 James Reeves, Stuart Sierra

Distributed under the Eclipse Public License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].