简体   繁体   中英

Can node.js files have extensions other than “.js” to differentiate client and server code in a text editor?

I am working with a node.js backend, and often when I have multiple tabs open in my text editor it is difficult to tell which javascript files that I'm editing are on the server, and which are on the client.

Is it possible to change the extension of node.js files to something like ".node" so that it's easier to tell the difference?

I realize that you could achieve this if you use typescript for either the client or the server (.ts files), but I'd prefer to use standard javascript.

If this is impossible, is there another way to differentiate server and client javascript in a text editor like vscode?

You can restructurer your project as client/... server/... Then, you can hover on tab to view path and clarify it .

You should use :

  • Text Editor: VS Code
  • IDE : Web Storm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM