Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
browserify no funciona en html básico y js básico

Estoy tratando de crear una página web simple para probar el módulo crypto en js, pero incluso cuando uso browserify, mi navegador devuelve Uncaught ReferenceError: require is not defined added.

Mi script.js:

 const { createHash } = require('crypto'); function hasher() { const password = document.getElementById("js_n_password").value; const hash = createHash(password); document.getElementById("hashed").innerHTML = password; }

Mi index.html:

 <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> <script src="bundle.js"></script> <script src="script.js"></script> </head> <body> <h1>Web Hash</h1> <form class="input" id="input"> <label for="n_password">Password:</label> <input type="password" id="js_n_password" name="n_password"> </form> <button onclick="hasher()">hash it</button> <p class="hashed" id="hashed"> </p> </body> </html>

¿Por qué browserify no funciona y cómo puedo hacer que funcione?

PD: agregar module.exports = function (n) { return n * 111 } a script.js no cambia nada.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!