Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-transform-default-export

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-transform-default-export - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

package.json
{
"name": "ts-transform-default-export",
"version": "1.0.0",
"version": "1.0.1",
"license": "ISC",

@@ -39,4 +39,4 @@ "description": "`export default foo` → `export = foo` → `module.exports = foo`",

"@types/tap": "^14.10.0",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"@typescript-eslint/eslint-plugin": "^3.9.0",
"@typescript-eslint/parser": "^3.9.0",
"eslint": "^7.6.0",

@@ -43,0 +43,0 @@ "eslint-config-prettier": "^6.11.0",

# ts-transform-default-export
![CI](https://github.com/axtgr/ts-transform-default-export/workflows/CI/badge.svg)
[![Buy me a beer](https://img.shields.io/badge/%F0%9F%8D%BA-Buy%20me%20a%20beer-red?style=flat)](https://www.buymeacoffee.com/axtgr)
[![CI](https://img.shields.io/github/workflow/status/axtgr/ts-transform-default-export/CI?label=CI&logo=github)](https://github.com/axtgr/ts-transform-default-export/actions)
A TypeScript transformer that converts default exports to their CommonJS counterparts:
A TypeScript transformer that converts a default export such as one of these:
`export { foo as default }` → `export = foo`
When such a module is then transpiled to CommonJS or UMD, the export will become `module.exports = foo`,
making the module consumable by `require('foo')` instead of `require('foo').default`.
The transformer is able to convert the following types of exports:
```ts

@@ -20,8 +14,11 @@ export default function foo() {}

Re-exports from other modules are not supported:
to its CommonJS counterpart:
```ts
export * from 'bar'
export = foo
```
When such a module is then transpiled to CommonJS or UMD, the export will become `module.exports = foo`,
making the module consumable by `require('foo')` instead of `require('foo').default`.
Only files that match the `files` or `include` property of your `tsconfig.json` will be transformed.

@@ -28,0 +25,0 @@ This is an intentional restriction to make it possible to control which files are processed.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc