4 ms·
does it interop with libs made for node.js and are on npm? e.g. using the official the AWS node.js library
by devmunchies 6y ago
does it interop with libs made for node.js and are on npm? e.g. using the official the AWS node.js library
- brundolf 6y agoIt doesn't load libs from NPM directly, it has its own package management system based around URLs. Most JavaScript/TypeScript logic should port to it trivially, unless they use system APIs, in which case those will have to be converted to Deno's system APIs. But mostly that just comes down to "swap out function X for Y and rearrange the parameters a bit". So in practice: it's super easy to port something, but most of the time you do actually have to port it, unfortunately.
- remexre 6y agoCan't comment on sibling, but https://www.skypack.dev/ https://www.skypack.dev/ lets you import many npm packages; I haven't tried the AWS library, though.
- wperron 6y agoThe canonical answer is _maybe_. If your Node lib relies on Node built-ins, you won't be able to import it directly from GitHub for example. However, CDNs like Skypack and esm.sh do polyfill some of those to Deno. Your mileage may vary depending on the lib you're trying to import. Some will work better on one CDN, some on another -- you really just have to try it for yourself. A surprising amount of libs work without issues. The AWS sdk v3 works really well from Skypack, check out our docs for our Deploy platform, it has an example with DynamoDB https://deno.com/deploy/docs/tutorial-dynamodb#write-the-application https://deno.com/deploy/docs/tutorial-dynamodb#write-the-app...