potentElixir

potentElixir

Brunch using javascript-obfuscator package

I got this package javascript-obfuscator, installed it via npm install --save.

When I view source of the page it shows up as installed.

But when I try to use it as described in the documentation:

var obfuscationResult = JavaScriptObfuscator.obfuscate(source_code, options);```

it throws error saying:
```Uncaught ReferenceError: __dirname is not defined
    at pjson.js:7```

And that line 7 is this: `var root = path.resolve(__dirname, "..", "..");`

I am so confused of this npm and brunch thing ... have opened so many pages and tried various things but not able to resolve this. 

Any help will be appreciated.

Most Liked

andre1sk

andre1sk

is only available in Node

andre1sk

andre1sk

It’s meant to be running in Node you are including it in the file that is getting sent to the browser.

Last Post!

potentElixir

potentElixir

Ah yes thats what I am doing.

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49134 226
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement