jstrace / jstrace

Dynamic tracing for javascript, in javascript (similar dtrace, ktap etc)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hostname pattern matching

tj opened this issue · comments

--name and --host are advertised as supporting patterns right now, but it would be handy to do --host api-* etc

+1 instead of a regex literal, most of the time you just want a simple wildcard. Maybe this String -> RegExp conversion strategy?

[Strings] are converted to a regular expressions by escaping all non-alphanumeric chars, then converting * into .* and finally wrapping it with ^ and $.
...
Where "/api/*.json" becomes the RegExp /^\/api\/.*\.json$/

I have a util already for glob-ish -> regexp, it's just not implemented yet in lib/server.js