wrap-in-iife
v0.2.2
Published
Wrap JS files in an IIFE
Downloads
2
Readme
wrap-in-iife
installation
npm install wrap-in-iife -g
Description
This module reads all files (recursively) in a directory and wraps the contents of each in a JavaScript Immediately Invoked Function Expression (IIFE).
Examples
Dry-Run
# Display list of files that would be created - each a copy of original, with an .iife extension
wrap-in-iife -s $MY_JS_FILES_DIR
# Display list of files that would be overwritten
wrap-in-iife -s $MY_JS_FILES_DIR -o
Write copies with .iife extension
wrap-in-iife -s $MY_JS_FILES_DIR -w
Overwrite originals
wrap-in-iife -s $MY_JS_FILES_DIR -w -o
# Overwrite originals, add 'use strict'
wrap-in-iife -s $MY_JS_FILES_DIR -w -o -u