Sublime Forum

Code Formatter without node

#1

Hello, in VIsual Studio Code is a possible (in fresh install) to format code without node.js. Is there any way how to take a part of that code what is able to format CSS without node.js and pass in into custom package? Any tip, how to find this file and that part of code?

I want auto format my CSS, JS, and PHP files, but i finded only autoformat for HTML without node.js

0 Likes

#2

Is there any way how to take a part of that code what is able to format CSS without node.js

Just like you want to copy-and-paste ST’s python plugins to make it work in VSCode’s built-in JS interpreter, no. If you really hate to depend on nodejs, then you have to find a pure python solution for ST or calling external executables (but this results in cross-platform problem). Unless ST is going to have nodejs as a built-in which I don’t think so.

Since you are doing web developing, I think nodejs is a common dependency.


CSS: https://packagecontrol.io/packages/CSS%20Format
JS: https://packagecontrol.io/packages/JsFormat
HTML: https://packagecontrol.io/packages/HTMLBeautify

These are all pure python but I would go for nodejs which has a much stronger community for frontend web dev utils…

1 Like

#3

Thank you for your patience with on my bad english. So in VSCode is node.js built-in and that is reason why at that editor is on fresh install able to this autoformat.
Can I install node.js into ST3 as user, or that is job only for creator? Sorry for stupid questions.

0 Likes

#4

Node.js works as an external JS interpreter. It’s not actually related to ST. You just have to make the node (or node.exe if on Windows) executable visible in the PATH environment. If you install Node.js with a installer from its official website, it should do it for you automatically (I guess).

1 Like

#5

I have node.js on my computer. The reason why I ask is that i sometimes work on someone else’s computer and I have ST3 portable version on my flashdisk. Is comfortable to only copy paste text editor without installation node.js (sometimes it’s not even possible to install anything).

On VSCode is a possible to works on my flashdisk without node.js on computer, that is comfortable for me, but VSCode have many bad thing for me, so I want to remain use ST3 which i thing that is best editor for me.

So thank you for your time. If I understand correctly, the one solution for me is using python packages. Installation node.js into ST3 folder is not good/working solution.

0 Likes

#6

node.exe can be portable as well (assuming you are always under Windows)

and then write a ST plugin to dynamically add it into the PATH env may work but I didn’t actually try that.

1 Like