sweet-js / sweet-core

Sweeten your JavaScript.
https://www.sweetjs.org
BSD 2-Clause "Simplified" License
4.58k stars 208 forks source link

Is there any way to import node stdlib modules? #730

Closed lujiajing1126 closed 7 years ago

lujiajing1126 commented 7 years ago

something like import path from 'path' for syntax;

I found a Error while importing modules like path

Error: ENOENT: no such file or directory, open 'path'

gabejohnson commented 7 years ago

Is path an installed module? If not, you have to use a relative path

import path from './path' for syntax;
lujiajing1126 commented 7 years ago

I mean here path is a built-in node stdlib. How can I install that?

disnet commented 7 years ago

Not yet. At the moment the only modules you can import for syntax must have a 'lang sweet.js' directive. The remaining module work is being tracked at #633 so I'll close this issue.