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.

    Add further npm dependencies to basic MM installation

    Scheduled Pinned Locked Moved Feature Requests
    4 Posts 3 Posters 1.3k Views 2 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.
    • lavolp3L Offline
      lavolp3 Module Developer
      last edited by lavolp3

      Hi all,
      this goes esp. to @MichMich but of course like to discuss with all @Module-Developers

      If I understand correctly, for npm dependencies to be used by module fiels there are basically two options

      • use what is in the MagicMirror/vendor (like moment.js) folder
      • have it installed via npm install in a node_modules folder of the module and set a link in the module file.

      Now there are some npm dependencies that are used in more than one 3rd party module.
      E.g.

      • I am using chart.js in three different modules a.t.m.
      • I have seen google-translate-api being used several times.

      Can’t we include these to the general MM installation and have them present only once and net in every in every module’s subfolder?
      I understand that we might not want to blow up the basic MM installation but I also think there are some trends for usage of certain npm modules.

      How to troubleshoot modules
      MMM-soccer v2, MMM-AVStock

      ? 1 Reply Last reply Reply Quote 0
      • ? Offline
        A Former User @lavolp3
        last edited by A Former User

        @lavolp3
        I want to recommend ‘iconify’ instead font-awesome, it include fa and more than that nonetheless its not related with npm.
        https://iconify.design

        1 Reply Last reply Reply Quote 0
        • MichMichM Offline
          MichMich
          last edited by

          The problem is I don’t want to bloat the basic installation. (Looking back I prefer to not have any additional vendors at all).

          And how would we select which dependencies we include in MM and which dependencies we don’t?

          What would be a great feature, is to allow a module to specify the rpm modules it requires and let MM install them on startup if they are not currently available. :)

          lavolp3L 1 Reply Last reply Reply Quote 1
          • lavolp3L Offline
            lavolp3 Module Developer @MichMich
            last edited by

            @michmich said in Add further npm dependencies to basic MM installation:

            And how would we select which dependencies we include in MM and which dependencies we don’t?

            Well that is obviously a case-by-case decision and therefore a bit tricky, I admit.
            But from these two I’m sure they are valuable to the MM environment.

            • A Google translation API (which tbh needs to be chosen carefully because one on npm is currently not working unfortunately)

            • A Charting tool.

            So why not use them? It’s “only” a few JS files.
            However, it’s your decision and I fully respect your point.

            How to troubleshoot modules
            MMM-soccer v2, MMM-AVStock

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              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