Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/txt2u/obfuscate-my-code
https://github.com/txt2u/obfuscate-my-code
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/txt2u/obfuscate-my-code
- Owner: txt2u
- License: mit
- Created: 2023-01-22T16:52:19.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-27T12:00:19.000Z (almost 2 years ago)
- Last Synced: 2025-01-04T07:05:55.970Z (7 days ago)
- Language: TypeScript
- Size: 25.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Obfuscate My Code
You can use this to obfuscate (AND, OR) minify your project files so it can't be easily stolen or to make it very hard to read.## Installation
### npm
```ruby
$ npm i obfuscate-my-code --save-dev
```
### yarn
```ruby
$ yarn add obfuscate-my-code --save-dev
```
### pnpm
```ruby
$ pnpm add obfuscate-my-code --save-dev
```## Example Code
### Typescript :
```ts
import path from 'path';
import { OBFMC } from 'obfuscate-my-code';const obf: OBFMC = new OBFMC();
obf.silentLog = true; // Default is false
obf.obfuscate('js', path.join(__dirname, '/mycodedir/'), 'browser');
obf.minifyDir(path.join(__dirname, '/i/want/to/minify/this/dir/'));
```
### Javascript :
```js
const path = require('path');
const { OBFMC } = require('obfuscate-my-code');const obf = new OBFMC();
obf.silentLog = true; // Default is false
obf.obfuscate('js', path.join(__dirname, '/mycodedir/'), 'browser');
obf.minifyDir(path.join(__dirname, '/i/want/to/minify/this/dir/'));
```## About obfuscate() last argument
Last argument of obfuscate() function is the options of the obfuscater and how it will obfuscate your files, It's optional there's options by default. But if you want to change it see https://obfuscator.io/ all the options of the page is the same as the argument.### Default Options :
```ts
{
compact: true,
simplify: true,
stringArray: true,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayThreshold: 0.75,
stringArrayIndexShift: true,
stringArrayIndexesType: ['hexadecimal-number'],
stringArrayWrappersCount: 1,
stringArrayWrappersType: 'variable',
stringArrayWrappersChainedCalls: true,
target: obfuscateTargetType,
seed: 0,
deadCodeInjection: false,
}
```### If you get any bug please let me know in the issues page.