open-index/open-npm huggingface dataset:
npm package: @kwruntime/core
Description: Runtime for typescript/civet, with URL imports, NPM imports, GITHUB imports, GITLAB imports and more. The fun of deno, inside node.js + civet language.
Author: Kode Best
Latest version: 2.0.23

# kwruntime/core (2.x)

Major update for this project. The entire process of importing URLs, files, and other languages has been redesigned.

Features of kwruntime/core

- Allows importing URLs (in the style of Deno)
- Allows importing npm packages directly at runtime, even for ESM packages
- Built-in support for TypeScript and Civet

## Getting started 

For installation instructions, click here: [INSTALL](./INSTALL.md)

--------


```bash 
kwruntime /path/to/file.civet
```

Within node.js

```javascript
const {kwruntime} = require("@kwruntime/core")

main()
async function main(){
	const axios = await kwruntime.import("npm:axios@0.27.2")
	const response = await axios("https://ipinfo.io")
	console.info("Response:", response.data)
}
```

or setting the execution to a file (similar result to how it would be executed in the terminal):

```javascript
const {kwruntime} = require("@kwruntime/core")
// execute the file server.civet
kwruntime.main([process.argv[1], __dirname + "/server.civet"])
```

## Typescript and civet support 

```typescript

interface Person {
  name: string;
  age: number;
}

function greet(person: Person): string {
  return "Hello, " + person.name + "!";
}

const alice: Person = {
  name: "Alice",
  age: 36
};

console.log(greet(alice));

```

You can also write in [Civet]("https://civet.dev"): 

```coffee
interface Person
	name: string
	age: number

function greet(person: Person): string
	return "Hello, " + person.name + "!"

alice: Person := 
	name: "Alice"
	age: 36
	
console.log greet alice
``` 

Output:

``` 
kwruntime test.civet
Hello, Alice!
```

## import from NPM packages, no need to install

Example: server.civet using express

```coffee
express from "npm:express@4.18.2"

app := express()
app.get "/", (req, res): void =>
	res.send "Welcome to the kwruntime!"
app.listen 8000
console.info "Server active"
``` 

And test:

``` 
curl http://127.0.0.1:8080
Welcome to the kwruntime!
```

## import from URL

```coffee
express from "https://esm.sh/express@4.21.2"

app := express()
app.get "/", (req, res): void =>
	res.send "Welcome to the kwruntime!"
app.listen 8000
console.info "Server active"
``` 

WARNING: Importing from esm.sh is a bit slow at the moment. It is recommended to import using npm as in the previous example.

Si quiere ver el progreso de la compilación de archivos typescript/civet, ajuste la variable de entorno DEBUG=1

```DEBUG=1 kwruntime /path/to/file```

And test:

``` 
curl http://127.0.0.1:8080
Welcome to the kwruntime!
```
npm package: @kwruntime/installer
Description: Script for install @kwruntime/core from node.js on all supported os
Latest version: 0.1.3

# kwruntime/installer

This project is an installer for [kwruntime/core](https://github.com/kwruntime/core). 
You can use directly `npx`, `pnpx`, this is the recommended way to install.

Preferrable use `nodejs` 14 or superior.

```bash
pnpx @kwruntime/installer 
# or
npx @kwruntime/installer
```

You should see a window like this: 

```bash

	░█─▄▀ ░█──░█ ░█▀▀█ ░█─░█ ░█▄─░█ ▀▀█▀▀ ▀█▀ ░█▀▄▀█ ░█▀▀▀ 
	░█▀▄─ ░█░█░█ ░█▄▄▀ ░█─░█ ░█░█░█ ─░█── ░█─ ░█░█░█ ░█▀▀▀ 
	░█─░█ ░█▄▀▄█ ░█─░█ ─▀▄▄▀ ░█──▀█ ─░█── ▄█▄ ░█──░█ ░█▄▄▄

	 ▀█▀ ░█▄─░█ ░█▀▀▀█ ▀▀█▀▀ ─█▀▀█ ░█─── ░█─── ░█▀▀▀ ░█▀▀█ 
	 ░█─ ░█░█░█ ─▀▀▀▄▄ ─░█── ░█▄▄█ ░█─── ░█─── ░█▀▀▀ ░█▄▄▀ 
	 ▄█▄ ░█──▀█ ░█▄▄▄█ ─░█── ░█─░█ ░█▄▄█ ░█▄▄█ ░█▄▄▄ ░█─░█


> Installing KwRuntime, please wait a moment.
Application added to PATH. Maybe you need restart shell.
Welcome to kwruntime/core version 1.1.18

					Press enter to close.
							CLOSE
```

Later, restart the ```terminal``` or ```cmd``` and you can use ```kwrun```

```bash 
> kwrun "github://kwruntime/std@808cb57/util/hello.ts"

[kwruntime] Compiling: https://raw.githubusercontent.com/kwruntime/std/808cb57/util/hello.ts
Welcome to @kwruntime/core 🥝😉
```
npm package: @kwruntime/win32reg
Description: Utility for read/write Windows registry
Author: James
Latest version: 0.1.3

# @kwruntime/win32reg

Utility for read/write Windows registry. Of course, can work on x86/x64 machines (and sure amr, no tested). 

NO NATIVE DEPENDENCIES.




## How works?

Works using [@kwruntime/typedotnet](https://github.com/kwruntime/typedotnet), a library for interact with .NET Framework and .NET 6

In all Windows, .NET Framework is installed by default, so this library should work out the box. 


## Getting started. 


> NOTE: version 0.1.1 was broken. Doesn't use


```typescript
import {registry} from "@kwruntime/win32reg"
// or 
const {registry} = require("@kwruntime/win32reg")


async function main(){
    
    await registry.createKeys(['HKLM\\SOFTWARE\\MyApp', 'HKCU\\SOFTWARE\\Foo'])

    // all stuff 
    ...
    
}
``` 

or if you prefer for example, select the runtime to use: 


```typescript
import {Registry} from "@kwruntime/win32reg"
// or 
const {Registry} = require("@kwruntime/win32reg")


async function main(){
    
    let registry = new Registry()
    await registry.start("netframework") // or netframework

    await registry.createKeys(['HKLM\\SOFTWARE\\MyApp', 'HKCU\\SOFTWARE\\Foo'])

    // all stuff 
    ...
    
    // call after all operations
    registry.close()
}
``` 


if you use [@kwruntime/core](https://github.com/kwruntime/core) you can import directly from URL: 

```typescript
// replace 0.1.0 with version or Git tag you want use:
import {Registry, registry} from "github://kwruntime/win32reg@0.1.0/src/mod.ts"
```


This library usage is based on ```regedit```, but internally using a method completely different. Doesn't need cscript or vbscript, and not start a new process on each action. 


```typescript
async function main(){
    const reg = new Registry()
    await reg.start() 

    try{
        await reg.putValues({
            'HKCU\\SOFTWARE\\MyApp': {
                // default values are empty keys
                '': {
                    value: 'Default value',
                    type: 'REG_SZ'
                },
                'Company': {
                    value: 'Moo corp',
                    type: 'REG_SZ'
                },
                'Version': { ... }
            },
            'HKLM\\SOFTWARE\\MyApp2': { ... }
        })

        await reg.createKeys(['HKLM\\SOFTWARE\\MyApp', 'HKCU\\SOFTWARE\\Foo'])

        await reg.list(["HKLM\\SOFTWARE\\MyApp"])
    }catch(e){
        console.error("Caught errors:", e)
    }
    finally{
        reg.close()
    }
}

```

or using ```RegItem``` style: 

```typescript
async function main(){
    const reg = new Registry()
    await reg.start() 

    try{
        let key = await reg.localMachine.openSubKey("SOFTWARE\\MyApp")

        // created if required
        await key.create()

        let values = await key.getAllValues()
        
        await key.dispose()

    }catch(e){
        console.error("Caught errors:", e)
    }
    finally{
        reg.close()
    }
}

```


API Reference: 

- [See types definition](./src/types/mod.ts)



## Build this module

```bash 
kwrun build 
```