Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Watch files (using a path, wildcards, or a regex) and execute a function or shell command.
Sentry is a simple node tool to watch for file changes (using a path, wildcards, or regexes) and execute a function or shell command. It's like a watchr or guard for node.
$ npm install sentry
sentry = require 'sentry'
# Watch changes in file.js
sentry.watch 'file.js', (file) -> console.log "A change has been made in #{file}"
# Watch changes on any file ending in .coffee one directory deep
sentry.watch 'fld/*.coffee', ->
# Watch changes recursively on any files
sentry.watch 'fld/**/*', ->
# Watch files recursively that match a regex
sentry.watchRegExp 'fld/', /regex/, ->
# If you pass a string instead of a function it'll execute that child process
sentry.watch 'file.coffee', 'coffee -c'
Sentry comes with two methods watch
and watchRegExp
.
Optionally you may pass a task which will send (err, stdout, stderr)
as the arguments to the callback
sentry.watch 'file.js', 'coffee -c', (err, stdout, stderr) ->
Or simply just a callback and Sentry will pass the filename to the callback
sentry.watch 'file.js', (filename) ->
Feel free to use wildcards with extensions
# Find all files one directory deep
sentry.watch '/folder/*', ->
# Find all files one directory deep ending in .coffee
sentry.watch '/folder/*.coffee', ->
# Find all files recursively
sentry.watch '/folder/**/*', ->
# Find all files recursively ending in .txt
sentry.watch '/folder/**/*.txt', ->
Just like sentry.watch but instead you must pass a root directory and regular expression to match files against.
# Find all files in this folder that end in .coffee
sentry.watchRegExp '', /\.coffee$/, ->
# Find all files in the adjacent 'test' folder that begin with test and end in .coffee
sentry.watchRegExp '../tests/', /^test_,.coffee$/, ->
Sentry uses Jasmine-node for testing. Simply run the jasmine-node command with the coffeescript flag
jasmine-node spec --coffee
FAQs
Watch files (using a path, wildcards, or a regex) and execute a function or shell command.
The npm package sentry receives a total of 7,873 weekly downloads. As such, sentry popularity was classified as popular.
We found that sentry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.