javascript dependencies in python project

前端 未结 3 833
一个人的身影
一个人的身影 2021-02-19 00:12

I\'m writing software that allows one to publish mathematical books as websites. It is based mostly on Python + Flask, but to deal with equations I\'m using MathJax. MathJax can

3条回答
  •  被撕碎了的回忆
    2021-02-19 00:53

    Using Node.js package.json would be the most optimal solution for dealing with JavaScript dependencies. As for executing executables from .py you can reference to this answer Running shell command from Python and capturing the output. Node dependencies are by default inside ./node_modules in the same directory as the location of your package.json file.

    For installing new dependencies:

    npm install --save npm-package-you-want-to-install
    

    Once you have them prepared this command will have everything installed for you:

    npm install
    

    Node dependencies are definitely more elegant way of dealing with things since javascript is a constantly evolving world and it is much easier to take a look at a package.json than a lot of script tags / functions that simply invoke said scripts. If you want a automated system my suggestion would be to make a executable (.sh) which will run installment for both and you can use that in your future projects.

提交回复
热议问题