summaryrefslogtreecommitdiff
path: root/node_modules/babel-plugin-minify-flip-comparisons/README.md
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
commitefbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch)
tree2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/babel-plugin-minify-flip-comparisons/README.md
parent43acceb75957c880a5ba5a31aae221394a36d5f6 (diff)
node fixes, updates
Diffstat (limited to 'node_modules/babel-plugin-minify-flip-comparisons/README.md')
-rw-r--r--node_modules/babel-plugin-minify-flip-comparisons/README.md55
1 files changed, 55 insertions, 0 deletions
diff --git a/node_modules/babel-plugin-minify-flip-comparisons/README.md b/node_modules/babel-plugin-minify-flip-comparisons/README.md
new file mode 100644
index 00000000..952dcd6c
--- /dev/null
+++ b/node_modules/babel-plugin-minify-flip-comparisons/README.md
@@ -0,0 +1,55 @@
+# babel-plugin-minify-flip-comparisons
+
+**Note:** while this plugin doesn’t shorten the output in any way, it does optimize it for repetition-based compression algorithms such as gzip.
+
+## Example
+
+**In**
+
+```javascript
+const foo = a === 1;
+if (bar !== null) {
+ var baz = 0;
+}
+```
+
+**Out**
+
+```javascript
+const foo = 1 === a;
+if (null !== bar) {
+ var baz = 0;
+}
+```
+
+## Installation
+
+```sh
+npm install babel-plugin-minify-flip-comparisons --save-dev
+```
+
+## Usage
+
+### Via `.babelrc` (Recommended)
+
+**.babelrc**
+
+```json
+{
+ "plugins": ["minify-flip-comparisons"]
+}
+```
+
+### Via CLI
+
+```sh
+babel --plugins minify-flip-comparisons script.js
+```
+
+### Via Node API
+
+```javascript
+require("@babel/core").transform("code", {
+ plugins: ["minify-flip-comparisons"]
+});
+```