• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

node_helper - using fs or request?

Scheduled Pinned Locked Moved Development
5 Posts 3 Posters 1.4k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    yawns Moderator
    last edited by Apr 2, 2019, 3:45 PM

    Hi guys,

    for one module currently requested I have to load a csv file with ~100kb and lots of content sitting inside the module folder.
    What do you think is more performant? Using request reading the file from “localhost” or using fs.readFile? Does it make any difference?

    Best regards,
    Stefan

    S 2 Replies Last reply Apr 2, 2019, 4:04 PM Reply Quote 0
    • S Away
      sdetweil @yawns
      last edited by Apr 2, 2019, 4:04 PM

      @yawns for such a small set of work, either is about the same…

      if u were doing this 20 times/second over hours, i might use the fs approach, but it depends on what you want to do with it later…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 1
      • S Away
        sdetweil @yawns
        last edited by Apr 3, 2019, 4:01 AM

        @yawns but… using the request approach would insulate you from changes needed to use a remote location source…

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        Y 1 Reply Last reply Apr 3, 2019, 11:25 AM Reply Quote 1
        • Y Offline
          yawns Moderator @sdetweil
          last edited by Apr 3, 2019, 11:25 AM

          @sdetweil said in node_helper - using fs or request?:

          @yawns but… using the request approach would insulate you from changes needed to use a remote location source…

          That’s a valid point, yes. I doubt this will be necessary or possible, but you never know. If it makes no difference in performance I will stick with the request.
          Thanks for your thoughts, Sam. Very much appreciated

          ? 1 Reply Last reply Apr 3, 2019, 12:56 PM Reply Quote 0
          • ? Offline
            A Former User @yawns
            last edited by Apr 3, 2019, 12:56 PM

            @yawns
            I think performance of ‘fs’ is absolutely faster than ‘request’.

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            1 / 1
            • First post
              5/5
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy