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

400
Vistas
How to approach storing code snippets in a database?

for my side project, I want to make a React app that has a textarea where you can paste code snippets in it and then hit save. Then I will store it into a database linked to their user account id for later retrieval.

Are there any good approaches generally used to do something like this? For example, to turn my javascript into a string and store it in a JSON format to be sent off to firebase?

I wanted to try using encodeURI at first but I couldn't even store the code inside a variable yet. Can anyone point me in the right direction? I'd appreciate it so much!

over 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

This could be a possible duplication of Is it safe to save user created javascript in database?

Although the general consensus is the risk is not high storing it. But it is high while retrieving and injecting it in the DOM for rendering.

So you should be good storing the the data as a string. But you'll have to be updated about any possible security issues that might pop up later that needs patching.

over 4 years ago · Santiago Gelvez Denunciar
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
Asistente virtual