Grepable typo-resistant namespaced constants
//// constants.jsconst cc =// define singlecc`my/namespace/pi `// define multiplecc`my/namespace/foofrobulate `//// file1.jsconst cc =const msg = type: cc`my/namespace/foo` // reference shared constant
String constants are easily mistyped. Aggregating constants in objects makes constants harder to grep and can still be mistyped. This libary is meant to provide a minimal syntax to define and reference constants in a safer and more consistent way.
- Users could still use names other than
ccand format the template in hard to grep ways.
- Constant is only checked if called. Better would be if this were a Babel transform to at least get compile-time errors if not editor feedback.