THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
require 'thor' | |
require "sub" | |
class MyApp < Thor | |
desc "parentcommand SUBCOMMAND", "Some Parent Command" | |
subcommand "sub", Sub | |
end | |
MyApp.start |
#!/usr/bin/env zsh | |
# This script prints a bell character when a command finishes | |
# if it has been running for longer than $zbell_duration seconds. | |
# If there are programs that you know run long that you don't | |
# want to bell after, then add them to $zbell_ignore. | |
# | |
# This script uses only zsh builtins so its fast, there's no needless | |
# forking, and its only dependency is zsh and its standard modules | |
# |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
var path = require('path'); | |
var _invalidateRequireCacheForFile = function(filePath){ | |
delete require.cache[path.resolve(filePath)]; | |
}; | |
var requireNoCache = function(filePath){ | |
_invalidateRequireCacheForFile(filePath); | |
return require(filePath); | |
}; |
🔍 see jay, yes! 🎉 / 👨🏻💻 see, JS! 👾 / ⚓️ sea JS ⛴
If you're publishing ES Modules, you need to also publish CommonJS versions of those modules.
This isn't to support old browsers or Node versions: even in Node 14, using require()
to load a module won't work if it's only available as ESM.
cjyes
is the bare minimum fix for this problem. You write ES Modules and fill out a valid package.json
, and it'll generate the corresponding CommonJS files pretty much instantly. cjyes
takes up 500kb of disk space including its two dependencies.