# strict-mode-ify

> A simple browserify transform that enables strict mode on JavaScript modules.

Latest version **0.1.1** (published 2015-09-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install strict-mode-ify
pnpm add strict-mode-ify
yarn add strict-mode-ify
bun add strict-mode-ify
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2015-09-18 |
| First published | 2015-09-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Levi Perelman |
| Maintainers | levp |
| Keywords | browserify, browserify-transform, transform, strict, strict-mode |

## Links

- npm: https://www.npmjs.com/package/strict-mode-ify
- Repository: https://github.com/levp/strict-mode-ify
- Homepage: https://github.com/levp/strict-mode-ify#readme
- Issues: https://github.com/levp/strict-mode-ify/issues
- npm.io page: https://npm.io/package/strict-mode-ify

## Dependencies (1)

- [through](https://npm.io/package/through.md) ^2.3.8

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2015-09-18
- 0.1.0 — 2015-09-18
- 0.0.1 — 2015-09-18

## README

# strict-mode-ify

A [browserify](https://github.com/substack/node-browserify) transform that
prepends a `"use strict";` statement to JavaScript modules.

## Usage examples

### Direct use

```js
var browserify = require('browserify');
var strictModeIfy = require('strict-mode-ify');

var b = browserify();
b.add('./src/main.js/');
b.transform(strictModeIfy({
  // strict-mode-ify options
}));
b.bundle().pipe(process.stdout);
```

### Command-line use

```
browserify -t [strict-mode-ify] src/main.js > dist/bundle.js
```

## Options

```
   test:  One of the following:
            [1] A RegExp object against which the file name will be tested to
                see if the module should be transformed.
            [2] A function with a file-name parameter that returns a truthy
                value if the module should be transformed.
            [default value] /\.js$/
            
newline:  A string that will be used as the newline character after
          the use-strict statement.
            [default value] '/n'
```

### Example of specifying options


```js
b.transform(strictModeIfy({
  // Will prepend the use-strict statement to modules originating from
  // JavaScript, TypeScript, and CoffeeScript files.
  test: /\.(js|ts|coffee)$/,
  // Platform-specific new line will be used.
  newline: require('os').EOL
}));
```

---
_Source: https://npm.io/package/strict-mode-ify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
