2 > A dictionary of file extensions and associated module loaders.
4 [![NPM](https://nodei.co/npm/interpret.png)](https://nodei.co/npm/interpret/)
7 This is used by [Liftoff](http://github.com/tkellen/node-liftoff) to automatically require dependencies for configuration files, and by [rechoir](http://github.com/tkellen/node-rechoir) for registering module loaders.
12 Map file types to modules which provide a [require.extensions] loader.
18 module: 'babel-register',
19 register: function (module) {
21 // register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353
22 // which only captures the final extension (.babel.js -> .js)
28 module: 'babel-core/register',
29 register: function (module) {
36 module: 'babel/register',
37 register: function (module) {
46 module: 'buble/register',
47 register: function (module) {
54 '.cirru': 'cirru-script/lib/register',
55 '.cjsx': 'node-cjsx/register',
57 '.coffee': ['coffee-script/register', 'coffee-script'],
58 '.coffee.md': ['coffee-script/register', 'coffee-script'],
59 '.csv': 'require-csv',
60 '.eg': 'earlgrey/register',
61 '.iced': ['iced-coffee-script/register', 'iced-coffee-script'],
62 '.iced.md': 'iced-coffee-script/register',
63 '.ini': 'require-ini',
66 '.json5': 'json5/lib/require',
69 module: 'babel-register',
70 register: function (module) {
77 module: 'babel-core/register',
78 register: function (module) {
85 module: 'babel/register',
86 register: function (module) {
94 register: function (module) {
102 '.litcoffee': ['coffee-script/register', 'coffee-script'],
103 '.liticed': 'iced-coffee-script/register',
104 '.ls': ['livescript', 'LiveScript'],
107 module: 'toml-require',
108 register: function (module) {
112 '.ts': ['ts-node/register', 'typescript-node/register', 'typescript-register', 'typescript-require'],
113 '.tsx': ['ts-node/register', 'typescript-node/register'],
114 '.wisp': 'wisp/engine/node',
115 '.xml': 'require-xml',
116 '.yaml': 'require-yaml',
117 '.yml': 'require-yaml'
122 Same as above, but only include the extensions which are javascript variants.
126 Consumers should use the exported `extensions` or `jsVariants` object to determine which module should be loaded for a given extension. If a matching extension is found, consumers should do the following:
128 1. If the value is null, do nothing.
130 2. If the value is a string, try to require it.
132 3. If the value is an object, try to require the `module` property. If successful, the `register` property (a function) should be called with the module passed as the first argument.
134 4. If the value is an array, iterate over it, attempting step #2 or #3 until one of the attempts does not throw.
136 [require.extensions]: http://nodejs.org/api/globals.html#globals_require_extensions