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

parse-name-import

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-name-import

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

parese-name-import

require node version >= 6.0

A script help you parse your file to transform whole module import to import only you need.

This is useful when the package you use support ES6 modules and you want to transform your old code to support ES6 modules import and save some space of your build file when using tree shaking(statically analyse the code and only include the bits of the library that are actually used).

For example transform

import THREE from "three";
const myMesh = new THREE.Mesh();

to

import { Mesh } from "three";
const myMesh = new Mesh();

Usage

node index.js [path] [replacedStatement]
  • [path]: the path the your folder or your file
  • [replacedStatement]: the import statement you want to replace

To transform example above, all you need is do the following.

node index.js /src/ 'import THREE from "three";'

Keywords

FAQs

Package last updated on 14 Jan 2017

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