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

imports-walk-ts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imports-walk-ts

Find 'import' and 're-export' statements in typescript using babel parser.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

imports-walk-ts

Find import and re-export statements in typescript using babel parser.

Install

npm i imports-walk-ts

Usage

source.ts

import moduleA from './module-a';
import moduleB from './module-b';
import moduleC = require('./module-c');
export * from './module-d';

program.ts

import importsWalkTs from 'imports-walk-ts';
import fs from 'fs';
const source = fs.readFileSync('source.ts', 'utf8');

importsWalkTs(source); // <= ['./module-a', './module-b', './module-c', './module-d']

API

importsWalkTs(src, options?)

Looks for import and re-export statements.

src

Type: String
Source, where import and re-export statements will be looked for.

options

Type: Object
Options are the same as babel parser options.

  • imports-walk - Find import and re-export statements of an ES6 module.
  • requires-walk - Find require() calls.

License

MIT 💖

Keywords

FAQs

Package last updated on 17 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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