Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
Best way to load module that is not used often

I have an express script (index.js( in which I load a bunch of api function from other js files. In one file (text.js) I am exporting a function that tokenizes text that requires the following:

const tokenize = require('chinese-tokenizer').loadFile('./cedict_ts.u8');

The cedict file is ~10MB.

The question is, when I deploy to firebase and index.js api functions are loaded, is the 10MB file preloaded into memory or is that when an api call occurs then the 10MB file is loaded? Also, if an api call happens that does require a function from text.js, would the 10MB still load into memory?

Basically, I want to figure out if it would be better to put the require call inside the function that tokenizes and not on top of text.js.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda