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

@blocz/detect-imports

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocz/detect-imports - npm Package Compare versions

Comparing version 0.1.0-beta.3 to 0.1.0

2

package.json
{
"name": "@blocz/detect-imports",
"version": "0.1.0-beta.3",
"version": "0.1.0",
"source": "src/index.ts",

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

# TL;DR
The goal of this library is to detect, in a JS code, the import statements, and parse them.
This is supposed to be used with MDX 1, so TypeScript is not supposed to be parsed (so syntaxes like `import type` or `import { type A }` won't be supported).
## How to use:
### Signature
```ts
detectImports(code: string): Promise<ImportDeclaration[]>
```
### Example
```js

@@ -4,0 +18,0 @@ import { detectImports } from "@blocz/detect-imports";

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