Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielkov/is-mangled
A simple one-liner to detect whether its execution environment had been mangled (minified) or not.
https://github.com/danielkov/is-mangled
development development-environment javascript utility
Last synced: about 2 months ago
JSON representation
A simple one-liner to detect whether its execution environment had been mangled (minified) or not.
- Host: GitHub
- URL: https://github.com/danielkov/is-mangled
- Owner: danielkov
- Created: 2017-07-31T10:35:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-31T11:35:21.000Z (over 7 years ago)
- Last Synced: 2024-12-02T04:43:45.567Z (2 months ago)
- Topics: development, development-environment, javascript, utility
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# isMangled
A simple one-liner to help determine whether the code you're executing had been minified or not.
___## Usage example
```js
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`.