Reading and Writing to a JSON file with Node

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

ความคิดเห็น • 21

  • @juanrios3066
    @juanrios3066 8 หลายเดือนก่อน +1

    vid is a gem and exactly what I was looking for

  • @leifetter9264
    @leifetter9264 9 หลายเดือนก่อน

    I'm probably not the only one that started looking for different node packages for a simple file DB solution, and ended up having problems with packages not supporting commonjs and fiddling around with the Typescript compiler to get compiled esm files unsuccessfully. This video made me motivated to try out working with JSON without having to rely on mysterious external dependencies, thank you!!

  • @TinyMaths
    @TinyMaths ปีที่แล้ว +1

    Well, this was very, very helpful. Funnily enough, I started to learn Node Js recently because I initially wanted to be able to ammend a json file that I am using to store data in an app I'm working on, but the fs writeFile tutorials had me completely lost; and after while it dawned on me that it might be a good idea to start learning node because I couldn't even get started without having node installed. So here I am; as a rookie, it's interesting seeing your thought process.

  • @OlaG-el9zr
    @OlaG-el9zr 4 ปีที่แล้ว +1

    you did superbly well.

  • @satnakamoto
    @satnakamoto ปีที่แล้ว

    Thanks, Buddy! Hugs from Brazil!

  • @TyrannicalKev
    @TyrannicalKev 2 ปีที่แล้ว

    This was a massive help to me - thank you dude

  • @JOHNSMITH-ve3rq
    @JOHNSMITH-ve3rq 3 ปีที่แล้ว

    amazing!!! exactly what I needed.

  • @lmnlghtt
    @lmnlghtt 4 ปีที่แล้ว

    Hi.. i ask.. how to push json objeck, for example
    var json = {
    "text":"text1",
    "ok" : "text2"
    }
    How to push the variable json?

  • @codeeasy7339
    @codeeasy7339 2 ปีที่แล้ว

    I want use require('fs') in client side server

  • @aqueuse
    @aqueuse 4 ปีที่แล้ว

    thank you very much, it's very usefull to see you experimenting

  • @manray3375
    @manray3375 4 ปีที่แล้ว +3

    Thank you so much, i Love your videos, Keep going

  • @abhinav.sharma
    @abhinav.sharma 4 ปีที่แล้ว

    Hey man, can you help me out, I want to create a local JSON based db, how do I apply CRUD operations on it, using NodeJS,
    this video shows Create and Read, how about update and delete?

  • @andre9468
    @andre9468 4 ปีที่แล้ว

    how can you delete a few or one "files" from the data.js

  • @siddarthkotthur1558
    @siddarthkotthur1558 4 ปีที่แล้ว +1

    what theme do you use for vs code?

    • @innovati
      @innovati  4 ปีที่แล้ว

      It's called 'Made of Code' and it's not super popular but does exist for various different editors

  • @rblakewatson
    @rblakewatson 5 ปีที่แล้ว +2

    I think you were missing the "./". Like:
    const data = require('./data.json');
    console.log(data.thing);

    • @randomTimeTV
      @randomTimeTV 4 ปีที่แล้ว +2

      the "./" means, the script have to search the required file in tne same folder. you don't need "./" if the requiered file/folder is in the node_modules folder

  • @mohammedjoubba318
    @mohammedjoubba318 4 ปีที่แล้ว +1

    you are awsome bro

  • @cienciasdedatosfran
    @cienciasdedatosfran 4 ปีที่แล้ว +1

    Amazing video, i think its not necessary to read the file to save JSON on it, you can manage the data by using require('file.json').
    Gained a new sub

  • @JOHNSMITH-ve3rq
    @JOHNSMITH-ve3rq 3 ปีที่แล้ว

    please post code to github or something so we can use it...

  • @amitapatra7414
    @amitapatra7414 4 ปีที่แล้ว +1

    nice video but keyboard sound is irritating.