New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-unused-exports

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-unused-exports - npm Package Compare versions

Comparing version 9.0.1 to 9.0.2

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## [9.0.2] - 15 Jan 2023
### Added
- Added better examples of how to use as a library, via TypeScript or JavaScript. No code was changed.
## [9.0.1] - 4 Jan 2023

@@ -2,0 +8,0 @@

2

package.json
{
"name": "ts-unused-exports",
"version": "9.0.1",
"version": "9.0.2",
"description": "ts-unused-exports finds unused exported symbols in your Typescript project",

@@ -5,0 +5,0 @@ "main": "lib/app.js",

@@ -39,20 +39,4 @@ # ts-unused-exports

or, as a library:
## Usage Options
```ts
import analyzeTsConfig from 'ts-unused-exports';
const result = analyzeTsConfig('path/to/tsconfig.json');
// or const result = analyzeTsConfig('path/to/tsconfig.json', ['file1.ts']);
// or const result = analyzeTsConfig('path/to/tsconfig.json', ['file1.ts', '--excludePathsFromReport=math']);
// result : { [index:string] : ExportNameAndLocation[] }
// where the keys are file paths and the values are a structure descibing unused symbols:
// interface ExportNameAndLocation {
// exportName: string;
// location: LocationInFile;
// }
```
Options:
| Option name | Description | Example |

@@ -81,2 +65,34 @@ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------- |

### Usage as a library
#### Usage as a library - From TypeScript (was built with ES5 + commonjs)
```ts
import analyzeTsConfig from 'ts-unused-exports';
const result = analyzeTsConfig('path/to/tsconfig.json');
// or const result = analyzeTsConfig('path/to/tsconfig.json', ['file1.ts']);
// or const result = analyzeTsConfig('path/to/tsconfig.json', ['file1.ts', '--excludePathsFromReport=math']);
// result : { [index:string] : ExportNameAndLocation[] }
// where the keys are file paths and the values are a structure descibing unused symbols:
// interface ExportNameAndLocation {
// exportName: string;
// location: LocationInFile;
// }
```
For an example see `./example/library-usage-via-TypeScript/`.
#### Usage as a library - From JavaScript
From JavaScript - depending on your environment, you may need to navigate to reach the analyzeTsConfig() function.
```js
import analyzeTsConfig from "ts-unused-exports";
const result = analyzeTsConfig.default('path/to/tsconfig.json');
```
For an example see `./example/library-usage-via-JavaScript/`.
## Why should I use this?

@@ -83,0 +99,0 @@

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