update tsconfig

This commit is contained in:
Philipp Kunz 2024-04-14 17:29:06 +02:00
parent b3d06e289b
commit a9a8ade848
4 changed files with 136 additions and 28 deletions

View File

@ -5,17 +5,29 @@
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartdeno",
"description": "a module to run deno from node",
"description": "A module to run Deno scripts from Node.js, including functionalities for downloading Deno and executing Deno scripts.",
"npmPackagename": "@push.rocks/smartdeno",
"license": "MIT",
"projectDomain": "push.rocks"
"projectDomain": "push.rocks",
"keywords": [
"Deno",
"Node.js",
"Script Execution",
"TypeScript",
"Development Tools",
"Deno Download",
"Code Execution",
"Scripting Server",
"Ephemeral Execution",
"Cross-platform"
]
}
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"tsdocs": {
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

View File

@ -2,7 +2,7 @@
"name": "@push.rocks/smartdeno",
"version": "1.0.3",
"private": false,
"description": "a module to run deno from node",
"description": "A module to run Deno scripts from Node.js, including functionalities for downloading Deno and executing Deno scripts.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
@ -52,5 +52,17 @@
"cli.js",
"npmextra.json",
"readme.md"
],
"keywords": [
"Deno",
"Node.js",
"Script Execution",
"TypeScript",
"Development Tools",
"Deno Download",
"Code Execution",
"Scripting Server",
"Ephemeral Execution",
"Cross-platform"
]
}

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

129
readme.md
View File

@ -1,31 +1,114 @@
# @push.rocks/smartdeno
a module to run deno from node
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartdeno)
* [gitlab.com (source)](https://gitlab.com/push.rocks/smartdeno)
* [github.com (source mirror)](https://github.com/push.rocks/smartdeno)
* [docs (typedoc)](https://push.rocks.gitlab.io/smartdeno/)
## Install
## Status for master
To install `@push.rocks/smartdeno`, run the following command in your project directory:
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/push.rocks/smartdeno/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/push.rocks/smartdeno/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/smartdeno)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/push.rocks/smartdeno)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@push.rocks/smartdeno)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/smartdeno)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/smartdeno)](https://lossless.cloud)
```bash
npm install @push.rocks/smartdeno --save
```
## Usage
Use TypeScript for best in class intellisense
For further information read the linked docs at the top of this readme.
## Legal
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
This guide will provide an overview of how to use `@push.rocks/smartdeno` in your Node.js project to run Deno scripts. Given the nature of the project, which allows running Deno from Node.js environments, we'll explore various scenarios including setup, executing a simple Deno script, integrating with existing Node.js workflows, and managing Deno downloads.
### Setting Up
First, ensure you import `SmartDeno` in your TypeScript file using the ESM syntax:
```typescript
import { SmartDeno } from '@push.rocks/smartdeno';
```
#### Initializing SmartDeno
To start working with Deno in your Node.js project, you first need to create an instance of `SmartDeno` and start it. This process prepares the environment, including downloading Deno if necessary:
```typescript
const smartDeno = new SmartDeno();
async function setup() {
await smartDeno.start({
forceLocalDeno: true // Use this to force a local download of Deno even if it's globally available
});
}
setup();
```
### Executing a Deno Script
With `SmartDeno` set and started, you can now execute Deno scripts. Let's run a simple script that prints a message:
```typescript
async function runDenoScript() {
const script = `console.log("Hello from Deno!");`;
await smartDeno.executeScript(script);
}
runDenoScript();
```
This method sends the script to Deno for execution. The flexibility of `SmartDeno` allows for more complex scripts to be executed similarly.
### Integrating with Node.js Workflows
`SmartDeno` can be seamlessly integrated into existing Node.js applications or workflows. Here's an example of integrating a Deno script execution within a Node.js Express server:
```typescript
import express from 'express';
const app = express();
const port = 3000;
app.get('/run-deno-script', async (req, res) => {
const script = `console.log("Deno script executed!");`;
await smartDeno.executeScript(script);
res.send('Deno script executed. Check console for output.');
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});
```
### Managing Deno Version
To manage which Deno version `SmartDeno` uses, the setup step allows for specifying `forceLocalDeno`. If you need to use a specific version of Deno, you can customize the download process by extending or modifying the download logic in `classes.denodownloader.ts`.
### Stopping SmartDeno
When your application is done using Deno, or if you need to clean up resources, you can stop the `SmartDeno` instance:
```typescript
async function teardown() {
await smartDeno.stop();
}
teardown();
```
### Conclusion
`@push.rocks/smartdeno` provides a powerful and simple pathway for Node.js applications to run Deno scripts, combine the strengths of both environments, and leverage Deno's features within Node.js projects. Whether it's for executing isolated scripts, taking advantage of Deno's security model, or using Deno modules, `SmartDeno` offers the tools necessary for seamless integration.
For further information and advanced use cases, refer to the official GitHub repository and the typed documentation linked at the top of this guide.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.