Ts-node: Isn't require.extensions deprecated?

Created on 16 Jul 2018  路  5Comments  路  Source: TypeStrong/ts-node

Hi everyone.

I've noticed that we register ts by calling require.extensions. But isn't it already deprecated since v0.10.6?

https://github.com/TypeStrong/ts-node/blob/743e80feca64b77887d7551568c2c4b777e2cad6/src/index.ts#L429

May be a fool question. If I missed something, please tell me :-)

Most helpful comment

@ahonn They're literally the same object, they're both deprecated. Just because one isn't in the docs doesn't mean it's not deprecated, it means it was never meant to be used to start with. That's what _ prefixes mean, they aren't meant for public use.

Edit: If you find it in documentation un-deprecated feel free to let me know.

All 5 comments

Yes. There鈥檚 no other way to make it work.

Why not use Module._extensions [ext]?

@ahonn

image

@blakeembrey But require.extensions already deprecated

@ahonn They're literally the same object, they're both deprecated. Just because one isn't in the docs doesn't mean it's not deprecated, it means it was never meant to be used to start with. That's what _ prefixes mean, they aren't meant for public use.

Edit: If you find it in documentation un-deprecated feel free to let me know.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

remojansen picture remojansen  路  4Comments

Borewit picture Borewit  路  3Comments

JoseLion picture JoseLion  路  3Comments

grissius picture grissius  路  3Comments

KiaraGrouwstra picture KiaraGrouwstra  路  3Comments