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

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
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
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44608 311
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement