Stability: 0 - Deprecated

    • {Object}

    Instruct require on how to handle certain file extensions.

    Process files with the extension .sjs as .js:

    1. require.extensions['.sjs'] = require.extensions['.js'];

    Deprecated. In the past, this list has been used to load non-JavaScript modules into Node.js by compiling them on-demand. However, in practice, there are much better ways to do this, such as loading modules via some other Node.js program, or compiling them to JavaScript ahead of time.

    Avoid using require.extensions. Use could cause subtle bugs and resolving the extensions gets slower with each registered extension.