Skip to content

danielkov/is-mangled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

isMangled

A simple one-liner to help determine whether the code you're executing had been minified or not.


Usage example

import isMangled from 'is-mangled'

let isProduction = false

if (isMangled()) {
    isProduction = true
}

Note that this is not a completely foolproof way of determining whether the code had been concatenated or otherwise altered. Some algorythms do not minify code this way, which means you should always test before relying on this function.

Installing

Install with npm i -S is-mangled or if you're even cooler, use yarn: yarn add is-mangled.

About

A simple one-liner to detect whether its execution environment had been mangled (minified) or not.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published