it's em!
it's em!9mo ago

Importing internal modules

I would like to use https://github.com/denoland/deno/blob/main/ext/console/01_console.js in my code, but it can't be directly imported from ext: because i'm writing a normal program and not working on the deno cli itself :P Do i just have to vendor and patch it? I'd really rather not.
GitHub
deno/ext/console/01_console.js at main · denoland/deno
A modern runtime for JavaScript and TypeScript. Contribute to denoland/deno development by creating an account on GitHub.
3 Replies
Deno AI Helper
Deno AI Helper9mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on your message, it seems like you're trying to import a module that is internal to Deno's runtime and not exposed for public use in the same way that third-party modules are. If you're looking to use functionality similar to what's in 01_console.js, you would typically import the console module that's already available globally in Deno. The global console object in Deno should have the standard methods you need, such as log, warn, error, etc. If you need functionality that is not exposed by the global console object, you might indeed have to copy (vendor) the code and modify it (patch it) to work with your application. This is not an ideal solution, as it could lead to maintenance issues down the line, especially when Deno updates its internal APIs. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice. If the functionality you need is not available in the standard library or through a third-party module, you may need to consider alternative solutions or workarounds that fit within the constraints of your project.
Leokuma
Leokuma9mo ago
which functions do you want to use?
it's em!
it's em!OP9mo ago
I just copied the table and css functions and wrote the rest myself but i wanted to make a custom console object that would output to a custom buffer