New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

use-strict-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-strict-cli

Adds or removes "use strict" from all JavaScript files within directory

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

use-strict-cli

This command line tool can be used to add or remove 'use strict'; from all JavaScript files within a directory.

Installation

npm install use-strict-cli -g

Usage

Command line help:

use-strict [dir1] [dir2] [dirX] [--remove]

All *.js files found within given directories and their sub-directories will be scanned.

Before running this command line tool it is recommended that you commit your current changes to source control or create a backup in case there are any undesirable changes.

Options:

  • --help: Help on using this command
  • --remove: Remove 'use strict' statements
  • --prefer: Preferred "use strict" statement (e.g. "use strict";)

Add 'use strict'; to all files that do not already have it:

use-strict ./src

Remove 'use strict'; from all files that have it:

use-strict ./src --remove

You will be prompted to confirm operation before changes will be saved.

Example

cd ~/myproject
use-strict ./src

Scanning following directories:
- /Users/johndoe/myproject/src


"use strict" statement will be added to the following files:
- server.js
- cluster.js

Continue? (yes) yes

Keywords

use

FAQs

Package last updated on 23 Oct 2015

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