GithubHelp home page GithubHelp logo

privatenumber / tsx Goto Github PK

View Code? Open in Web Editor NEW
7.7K 15.0 109.0 1.84 MB

⚡️ TypeScript Execute: Node.js enhanced to run TypeScript & ESM

Home Page: https://tsx.is

License: MIT License

TypeScript 99.21% JavaScript 0.79%
esbuild esm node typescript loader runtime cli watch

tsx's Introduction

tsx

TypeScript Execute (tsx): The easiest way to run TypeScript in Node.js

Documentation    |    Getting started →


Premium sponsor banner

Tip

Build your TypeScript projects?

Try pkgroll—the zero-config package bundler used by tsx!

pkgroll is a thin Rollup wrapper that makes it so simple for your package to support CommonJS, ESM, & TypeScript.

If you love tsx, you'll love pkgroll too!

Sponsors

tsx's People

Contributors

amitdahan avatar antfu avatar brc-dd avatar cenfun avatar dcousens avatar dylanpiercey avatar fz6m avatar ilyasemenov avatar jakzo avatar jbergstroem avatar leumasme avatar louislam avatar mariuso avatar noriller avatar nwalters512 avatar paescuj avatar patheticgeek avatar pedablio avatar privatenumber avatar qiuqfang avatar renovate[bot] avatar romanlamsal avatar sadkebab avatar sgarner avatar silverwind avatar skimhugo avatar st-ddt avatar tony19 avatar vaakian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tsx's Issues

Avoid address-already-in-use errors when using watch & inspect

Feature request

When using tsx watch --inspect=..., when files change, the node debug server is briefly stopped & restarted.

This makes sense, but if I've attached a debugger in Webstorm, I'd ideally like the debugger to stay connected across restarts / as I'm editing and changing files.

Currently if I tell Webstorm debugger to "Reconnect automatically" on disconnect, it seems to grab the port 9229 before the tsx's restarted node takes it, so I get an error:

  Starting inspector on 0.0.0.0:9229 failed: address already in use

Why?

I'd like to have a really pleasant "the debugger stays connected and it just works across restarts" workflow.

Alternatives

I'd used ts-node-dev in the past, and I swear they had this working, i.e. somehow webstorm could auto reconnect across restarts, without getting "port in use" conflicts.

Maybe I'm just wrong/making this up though, b/c I'm not sure how they would prevent this, without running their own proxy on the port that forwards to the currently-booted node process...

Otherwise, to work around this, I'm just disabling the webstorm auto-reconnect, and I have to remember to keep clicking "connect debugger" after time I change a file.

Additional context

No response

Expose esbuild `loader` option

Hi,

Thanks for the great library. I'm in the process of migrating entirely away from babel (if i can do it!) and I'd like to use this as my transpiling runtime.

However, I have some feature differences between the development mode (using tsx) and in production (using transpiled files).

Esbuild supports a loader syntax:

  --loader:X=L          Use loader L to load file extension X, where L is
                        one of: js | jsx | ts | tsx | css | json | text |
                        base64 | file | dataurl | binary
                        

However tsx does not, so when i have a file that requires something I will treat as a string such as const template = require('./email-template.tpl'), tsx errors out.

I believe I am using both tools correctly, but happy to provide more information on the usage.

Detect when running in tsx

Feature request

Like to know if there is a convienient way to know if running in tsx?

It's similar to the request like this: TypeStrong/ts-node#846
Or something like adding env: process.env.TS_NODE_DEV

I tried to add set env in run.ts and it works like a charm:

export function run(
  argv: string[],
    options?: {
      noCache?: boolean;
      ipc?: boolean;
    },
) {
+  if (process.env.TSX === undefined) {
+    process.env.TSX = 'true'
+  }
    const environment = {
      ...process.env,
    };

I can open a PR if you think it's a good approach / design.

Why?

I'm working on replacing the ts compiling step & start server in developing fastify app.
tsx works great and IMO it's better than ts-node, tsm or any other ts runtime in Node.

I used a fastify plugin fastify-autoload to load my fastify plugins and routes automatically.
While I was stuck because tsx is not yet supported as a ts runtime in fastify-autoload.

Here is how fastify-autoload detects which ts runtime:

const isTsNode = (Symbol.for('ts-node.register.instance') in process) || !!process.env.TS_NODE_DEV
const isJestEnvironment = process.env.JEST_WORKER_ID !== undefined
const isSWCRegister = process._preload_modules && process._preload_modules.includes('@swc/register')
const isSWCNode = typeof process.env._ === 'string' && process.env._.includes('.bin/swc-node')
const isTsm = process._preload_modules && process._preload_modules.includes('tsm')
const typescriptSupport = isTsNode || isJestEnvironment || isSWCRegister || isSWCNode || isTsm

My thought is if can add env like process.env.TSX, then I can open a PR there for adding tsx support.

- const typescriptSupport = isTsNode || isJestEnvironment || isSWCRegister || isSWCNode || isTsm
+ const isTSX = !!process.env.TSX
+ const typescriptSupport = isTsNode || isJestEnvironment || isSWCRegister || isSWCNode || isTsm || isTsx

Alternatives

The only workaround at this moment is to set NODE_OPTIONS:
NODE_OPTIONS='--loader tsx' node ./file.ts
So I can detect by access process.env.NODE_OPTIONS, but I can't use watch mode and it'd be better to use tsx purely.

Additional context

No response

How to get info about type in REPL

Feature request

> type t = string
> t
Type string

Why?

It will be helpful to get typing info in REPL.

Alternatives

Also maybe to use some specific genetic, like Type<t> will be nicer

Additional context

No response

Support automatically loading modules

Feature request

I frequently want to run commands/scripts in my project with "some defaults" applied; typically these defaults are a) using ts-node, and b) using some env variables from a local.env file.

Historically I've solved this with an extra run.sh script that looks something like:

#!/bin/bash

export $(grep -v '^#' env/local.env | sed 's/\"/\\\"/g' | xargs)

./node_modules/.bin/ts-node "$@" 

But it's cumbersome to copy/paste around and kind of crufty in general.

I'd noticed tsx would be able to solve my "use ts-node by default" need, which is great, but I'm hoping it could also solve my "using some env variables by default" need, albeit without adding that explicitly to tsx, and maybe instead via some generic config.

I've thought of two ideas, one might be a .tsxrc type file that looks like:

NODE_OPTIONS=-r myCustomModule

Or another is something in package.json:

{
  "tsx": {
     "require": "myCustomModule",
     "NODE_OPTIONS: "-r myCustomModule"
  }
}

Where myCustomModule would be something that could auto-load the local.env file / whatever based on my app's specific conventions.

As a disclaimer, I know this is probably out-of-scope to tsx's core "just run TypeScript automatically" mission, but dunno, thought it wouldn't hurt to at least ask to see if you find this use case worth supporting. Thanks!

Why?

I'm frustrated that there's not an easy way to apply default settings/behavior to the scripts I run in my project.

Alternatives

I've been using a run.sh shell script; happy to learn of better alternatives if there any.

Additional context

No response

Add MacOS Support?

Feature request

MacOS is the mainstream development operating system.

Why?

I use Linux, Windows and MacOS at the same time, according to my different application scenarios.
Especially looking forward to adding support for MacOS. thanks.

Alternatives

No response

Additional context

No response

tsconfig path

I am trying to send an explicit tsconfig path

esno --tsconfig=tsconfig.server.json ./server/**/*.ts 

and it doesn't seem to allow any other args (at least those supported by esbuild)
v16.0.0/bin/node: bad option: --tsconfig=tsconfig.server.json
How do I work around this?

ESM syntax in REPL doesn't work

Bug description

Have some .ts file and try to import it using ESM syntax in the REPL. The variable will be left undefined.

Reproduction

index.ts:

export default "Hello, World!";
❯ tsx
Welcome to tsx v3.6.0 (Node.js v16.15.1).
Type ".help" for more information.
> import hello from './index'
undefined
> hello
Uncaught ReferenceError: hello is not defined
>

Environment

  System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 440.86 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.15.1/bin/yarn
    npm: 8.13.1 - ~/.nvm/versions/node/v16.15.1/bin/npm

tsx is version 3.6.0, envinfo fails to list it for some reason.

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Can't "watch" and specify custom tsconfig at the same time

Bug description

I can't run tsx in watch mode when I'm also loading a custom tsconfig.

Reproduction

tsx --tsconfig ts.dev.json ./src/index.ts works ✔️
tsx watch ./src/index.ts works ✔️

but
tsx watch --tsconfig ./tsconfig.dev.json ./src/index.ts
return the error : node.exe: bad option: --tsconfig

and
tsx --tsconfig ./tsconfig.dev.json watch ./src/index.ts return the error :
Error [ERR_MODULE_NOT_FOUND]: Cannot find module watch because it thinks "watch" is the ts file to load.

Environment

TSX: 3.7.1
Node: 16.15.0

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Can't use --inspect and watch at the same time

Bug description

What did you do? (Provide reproduction code in next section)

Ran tsx --inspect watch src/index.ts

What did you expect to happen?

Code the execute successfully, in watch mode, with the --inspect flag being passed to node

What happened instead?

tsx --inspect watch src/index.ts
Debugger listening on ws://127.0.0.1:9229/de18515f-4447-4d8a-8d1d-4270a2e9387c
For help, see: https://nodejs.org/en/docs/inspector
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/shahmirn/dev/logistics-platform/packages/workers/watch' imported from /home/shahmirn/dev/logistics-platform/packages/workers/

Reproduction

cd /tmp
touch index.ts
tsx --inspect watch index.ts

Blows up

tsx watch index.ts and tsx --inspect index.ts both work fine

Environment

  System:
    OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 4.63 GB / 7.68 GB
    Container: Yes
    Shell: 5.8 - /home/linuxbrew/.linuxbrew/bin/zsh
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v16.15.1/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Nestjs undefined injected class method

I got error on appService property:

TypeError: Cannot read properties of undefined (reading 'getHello')
    at AppController.getHello (/home/satont/Tests/project-name/src/app.controller.ts:10:28)
    at <anonymous> (/home/satont/Tests/project-name/node_modules/.pnpm/@[email protected]_fkqgj3xrohk2pflugljc4sz7ea/node_modules/@nestjs/core/router/router-execution-context.js:38:29)
    at InterceptorsConsumer.intercept (/home/satont/Tests/project-name/node_modules/.pnpm/@[email protected]_fkqgj3xrohk2pflugljc4sz7ea/node_modules/@nestjs/core/interceptors/interceptors-consumer.js:11:20)
    at <anonymous> (/home/satont/Tests/project-name/node_modules/.pnpm/@[email protected]_fkqgj3xrohk2pflugljc4sz7ea/node_modules/@nestjs/core/router/router-execution-context.js:46:60)
    at <anonymous> (/home/satont/Tests/project-name/node_modules/.pnpm/@[email protected]_fkqgj3xrohk2pflugljc4sz7ea/node_modules/@nestjs/core/router/router-proxy.js:9:23)
    at Layer.Layer.handle_request (/home/satont/Tests/project-name/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/satont/Tests/project-name/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/route.js:144:13)
    at Route.Route.dispatch (/home/satont/Tests/project-name/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/route.js:114:3)
    at Layer.Layer.handle_request (/home/satont/Tests/project-name/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/layer.js:95:5)
    at <anonymous> (/home/satont/Tests/project-name/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:284:15)

When class imported via nestjs DI as constructor(private readonly appService: AppService) {}

Reproduction:

npm i -g @nestjs/cli
nest new project-name
cd project-name
pnpm install
tsx src/main.ts
curl http://localhost:3000

Or you can clone https://github.com/nestjs/typescript-starter, and perform latest 3 steps.

tsx version: 3.4.3
nodejs version: 18.2.0

Also as fact, i tested CJS and ESM, same behavior.

Cannot import named export from a typescript file in a workspace package if entry is using es modules and other package is not.

Cannot import named export from a typescript file in a workspace package if entry is using es modules and other package is not.

tsx will throw

SyntaxError: The requested module 'ts-package/src/file' does not provide an export named 'x'

I know this could be considered a node limitation but maybe we can compile typescript files to esm if entry is esm (even if workspace package does not have "type": "module"

Repro: https://github.com/remorses/tsx-repros

pnpm i
pnpm run import-ts-file

Add ability to enable `watch` using a flag

Feature request

Add ability to enable watch using a flag

Why?

When there is already an existing npm script, ex. package.json:

{
  "scripts": {
    "start": "tsx example.ts"
  }
}

There's no easy way to start and watch. You either need to create a bash script within an npm script or a separate npm script.

Instead, if watch could be enabled via a flag, then you could do:

$ npm run start --watch

or, you could make the invocation npm scripts reusable by other npm scripts.

Alternatives

Additional context

No response

Support `emitDecoratorMetadata`

some typescript and node framework (like nestjs) use emitDecoratorMetadata , but esbuild not support it, and @anatine/esbuild-decorators plugin can solve it .
but esbuild's transform api not support plugin,some can change the api to use build?

like the follow code

async function transpile(code, filename, options = {}) {
    const ext = path.extname(filename);

    const loaders = getLoaders(options);

    const builded = await build({
        ...commonOptions,
        platform: 'node',
        ...options,
        ...{
            loader: loaders,
            bundle: true,
            stdin: {
                sourcefile: filename,
                contents: code,
                resolveDir: path.dirname(filename),
                loader: loaders[ext],
            },
            external: [...externals, ...(options.external ?? [])],
            write: false,
            plugins: [
                ...(options.plugins ?? []),
                esbuildDecorators({ tsconfig: options.tsconfig ?? undefined }),
            ],
        },
    });
    return builded.outputFiles.map((f) => f.text).join('\n');
}

vscode debugger example

Feature request

Can you provide a vscode debugger example?

Why?

package.json

"scripts": {
    "build": "tsx build/index.ts",
}

.vscode/launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch via NPM",
      "request": "launch",
      "runtimeArgs": ["run-script", "build"],
      "runtimeExecutable": "npm",
      "skipFiles": ["<node_internals>/**"],
      "type": "node"
    }
  ]
}

I configured it as above, the breakpoints are not using the source map, the debugger is displayed in index.js

Alternatives

Additional context

No response

Support `.js` → `.ts` conversion in local export map

Feature request

Using tsx it’s possible to write import … from './index.js'. It’s ok if index.js doesn’t exist, but only index.ts. It will just resolve to that.

If package.json contains an exports field, it’s valid to import the package by name instead of by a path reference.

For example, after compilation of https://github.com/remcohaszing/remark-mdx-frontmatter, it’s valid to rewrite the compiled test to use import remarkMdxFrontmatter from 'remark-mdx-frontmatter' in test.ts. This won’t work without compiling first.

I suggest to make tsx use the same logic for aliasing .js.ts after resolving package.json exports as it does for relative imports.

Why?

  1. When testing the public interface, tests closer match how a user would use a package.
  2. This allows to use tsx for importing other local packages inside a mono repo.

Alternatives

N/A

Additional context

No response

Legacy importing type from namespace is not supported

Bug description

import { Rule, Scope } from 'eslint'; // `Rule` and `Scope` are both ts namespace
import Variable = Scope.Variable;
import CodePathSegment = Rule.CodePathSegment;
import Variable = Scope.Variable;
                        ^

TypeError: Cannot read properties of undefined (reading 'Variable')

Reproduction

import { Rule, Scope } from 'eslint';
import Variable = Scope.Variable;
import CodePathSegment = Rule.CodePathSegment;

Environment

  System:
    OS: macOS 13.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 31.99 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.16.0 - ~/Library/Caches/fnm_multishells/55951_1660375587006/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.16.0 - ~/Library/Caches/fnm_multishells/55951_1660375587006/bin/npm
  npmPackages:
    tsx: ^3.8.2 => 3.8.2

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Improper handling of graceful exits

Bug description

tsx does not wait for script to exit gracefully before terminating the process.

Reproduction

Let's say you have main.ts as the following:

console.log('starting up');

process.on('SIGINT', () => {
  console.log('shutting down');

  // simulate cleanup
  setTimeout(() => {
    console.log('cleanly exiting');
    process.exit(0);
  }, 5000);
});

// run forever
setInterval(() => {}, 1 << 30);

Running main.ts via node --no-warnings --loader tsx main.ts will produce the correct behavior, i.e. pressing CTRL+C will signal the script to start cleaning up and then exit gracefully.

On the other hand, when running via tsx main.ts, the process will exit abruptly when signaled without waiting for the script to completely finish cleaning up.

Environment

System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
    Memory: 10.00 GB / 15.52 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.7.0 - /usr/local/node/bin/node
    npm: 8.15.0 - /usr/local/node/bin/npm
  npmPackages:
    tsx: ^3.8.2 => 3.8.2

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

FR: Configure `tsx` in `tsconfig.json`

ts-node supports the following:

{
  "compilerOptions": {...},
  "ts-node": {
    "compilerOptions": {...},
    "require": [
      "dotenv-flow/config"
    ]
  }
}

In my monorepo, this makes it really easy to keep config out of CLI args. In particular, having access to require makes all my scripts draw env-vars properly with minimum fuss.

I'd like to be able to do the same thing with tsx. I saw a previous ticket where you expose --require, though it's undocumented in the CLI help text. I'm not against using it for the time being, but for dozens of scripts, it's overkill to insert it everywhere.

Thanks for such an awesome project!

enable sponsoring on github

Feature request

i love tsx and would like to sponsor you on github

Why?

.

Alternatives

Additional context

No response

Support new experimental built-in node test runner

Feature request

NodeJS has a new experimental built-in test runner in version 18+. It is typically invoked for JavaScript files via node --test or node --test test/**/*.test.js, for example.

I would like to be able to invoke the new node test runner via tsx:

  • npx tsx --test - ideal, but the test runner doesn't pick up .ts files by default
  • npx tsx --test test/**/*.test.ts - explicit path(s) to test files

Currently when I try those commands, it does start the test runner and prints out the first line, then hangs and has to be interrupted. Looks like it is starting the node REPL, so maybe tweaking that behavior is all that's needed.

$ npx tsx --test test/**/*.test.ts
TAP version 13

# !!! Hangs here until I press Ctrl+C

# Subtest: /home/neodon/.local/share/pnpm/store/v3/tmp/dlx-34798/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/repl.js
not ok 1 - /home/neodon/.local/share/pnpm/store/v3/tmp/dlx-34798/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/repl.js
  ---
  duration_ms: 6.935629576
  failureType: 'cancelledByParent'
  error: 'test did not finish before its parent and was cancelled'
  code: 'ERR_TEST_FAILURE'
  stack: |-
    process.emit (node:events:513:28)
    process.emit (/home/neodon/.local/share/pnpm/store/v3/tmp/dlx-34798/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/suppress-warnings.cjs:1:307)
  ...
# Subtest: /home/neodon/p/labs/test/foo.test.ts
ok 2 - /home/neodon/p/labs/test/foo.test.ts
  ---
  duration_ms: 0.082254723
  ...
1..2
# tests 2
# pass 1
# fail 0
# cancelled 1
# skipped 0
# todo 0
# duration_ms 6.964441232

Why?

Currently I am able to run the node test runner with tsx by using it as a loader, so this feature is more of a minor thing / polish. It could be more intuitive to new users.

Example:

// test/foo.test.ts
import test from 'node:test'
import assert from 'node:assert/strict'

test('node test!', async t => {
  assert.equal(true, true)
})

In package.json, I have "type": "module" set.

I can run the tests with:

$ node --loader tsx --test test/**/*.test.ts
TAP version 13
# Subtest: /home/james/p/labs/test/foo.test.ts
ok 1 - /home/james/p/labs/test/foo.test.ts
  ---
  duration_ms: 0.076968906
  ...
1..1
# tests 1
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 0.103634573

This is fine for me, but wouldn't it be awesome if you could run tests with tsx --test, analagous to node --test? 😎

Alternatives

No response

Additional context

No response

TypeError: Unexpected response from worker: undefined

I'm using ts-node to run nextjs app (custom server).

yarn dev: ts-node --project tsconfig.server.json server/index.ts

Using tsx throws the below error

/Users/<path>/node_modules/jest-worker/build/workers/ChildProcessWorker.js:264
        throw new TypeError('Unexpected response from worker: ' + response[0]);
              ^

TypeError: Unexpected response from worker: undefined
    at ChildProcessWorker._onMessage (/Users/<path>/node_modules/jest-worker/build/workers/ChildProcessWorker.js:264:15)
    at ChildProcess.emit (node:events:527:28)
    at emit (node:internal/child_process:938:14)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)

p.s: thanks for bringing this :)

tsx does not respect tsconfig path aliases?

My tsconfig.json has the following:

    "paths": {
      "~/*": ["./app/*"]
    },

However, it seems like tsx doesn't take this into consideration. (E.g, I'll get file not found errors).

Is there anyway to work around this?

Unable to import a synthetic named export in a CJS file from ESM

Bug description

  • What did you expect to happen?
    Supports default imports even for cjs.

  • What happened instead?
    Default imports are retrieved at object.

{ default: 'hi' }

Reproduction

// test1.cjs
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const hi = 'hi';
exports.default = hi;
  • Default import of cjs from esm
// test2.mts
import hi from './test1.cjs'
console.log(hi)
  • Execute mts
tsx test2.mts

Environment

  System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
    Memory: 136.99 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.15.1 - /usr/local/bin/node
    npm: 8.11.0 - /usr/local/bin/npm
  npmPackages:
    tsx: ^3.8.0 => 3.8.0

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Expose --require and --loader hook from this module.

Would be great if the require and loader hooks from the other esbuild-kit modules were exposed from this top level one. In some scenarios I wan't to use the main tsx bin, but still the others are handy and it'd be nice if I didn't have to install other modules.

I was thinking it should be as simple as adding a exports to this module that with the import condition would expose the loader and otherwise would expose the require hook such that you could:

node -r tsx
node --loader tsx

as an example of where this is useful:

mocha -r tsx

require causes a warning

Bug description

Try to import a plain CommonJS module using require from a tsx REPL.

Reproduction

index.js:

exports.foo = 123;
❯ tsx
Welcome to tsx v3.8.1 (Node.js v16.16.0).
Type ".help" for more information.
> const foo = require('.')
{
  detail: undefined,
  id: 'unsupported-require-call',
  location: {
    column: 12,
    file: 'REPL1.js',
    length: 7,
    line: 1,
    lineText: "const foo = require('.')",
    namespace: '',
    suggestion: ''
  },
  notes: [],
  pluginName: '',
  text: 'Converting "require" to "esm" is currently not supported'
}
undefined
> foo
{ foo: 123 }
>

Environment

  System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 117.00 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.16.0/bin/yarn
    npm: 8.17.0 - ~/.nvm/versions/node/v16.16.0/bin/npm

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Auto-restart on crash

Feature request

Auto-restart TSX when crash is detected

Why?

Useful for a live service / development

Alternatives

Additional context

No response

tsconfig paths not resolving in imported package

Bug description

I have a monorepo with two packages a and b. I run a script in package a which imports a module from package b. The module in package b imports a submodule from package b using tsconfig paths.

I expect the script to run normally.

Instead, it crashes:

❯ p tsx test.ts 
Error: Cannot find module '@/lib'
Require stack:
- /Users/semenov/tmp/tsx-monorepo-alias/packages/b/index.ts
- /Users/semenov/tmp/tsx-monorepo-alias/packages/a/test.ts
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.u.default._resolveFilename (/Users/semenov/tmp/tsx-monorepo-alias/node_modules/.pnpm/@[email protected]/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:1486)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/semenov/tmp/tsx-monorepo-alias/packages/b/index.ts:1:8)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.v (/Users/semenov/tmp/tsx-monorepo-alias/node_modules/.pnpm/@[email protected]/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:933)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/semenov/tmp/tsx-monorepo-alias/packages/b/index.ts',
    '/Users/semenov/tmp/tsx-monorepo-alias/packages/a/test.ts'
  ]
}

Reproduction

https://github.com/IlyaSemenov/tsx-monorepo-import-reproduction includes step by step reproduction.

By the way, if you run pnpm add esbuild-runner and run the script with pnpm esr test.ts, it will work! (esbuild-runner is unfortunately abandoned and has other issues)

Environment

System:
    OS: macOS 12.5
    CPU: (8) arm64 Apple M1
    Memory: 74.92 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nodenv/versions/16.15.0/bin/node
    Yarn: 1.22.19 - ~/.nodenv/versions/16.15.0/bin/yarn
    npm: 8.5.5 - ~/.nodenv/versions/16.15.0/bin/npm

tsx is version 3.8.1

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Unused files published

Bug description

.cjs files should be defined in exports, or remove them from dist

And @esbuild-kit/esm-loader is ESM-only, so we should remove .cjs files from dist

Reproduction

https://unpkg.com/browse/[email protected]/package.json

Environment

  System:
    OS: Linux 5.16 Ubuntu 20.04.4 LTS (Focal Fossa)
    CPU: (16) x64 AMD EPYC 7B13
    Memory: 33.70 GB / 62.80 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.15.1/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
  npmPackages:
    tsx: ^3.6.0 => 3.6.0

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

alwaysStrict not respected

Bug description

Esbuild supports the alwaysStrict compiler option https://github.com/evanw/esbuild/blob/9860ee3b1ff83b7c6e8889e96da42add36d50ba3/internal/resolver/tsconfig_json.go#L40

However this does not appear to be supported in tsx.

It's possible that this is related to nodejs/node#30039

Reproduction

❯ cat tsconfig.json
{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Expo",
  "compilerOptions": {
    "module": "esnext",
    "noUnusedLocals": true,
    "allowJs": true,
    "esModuleInterop": true,
    "jsx": "preserve",
    "lib": [
      "DOM",
      "ESNext"
    ],
    "moduleResolution": "node",
    "noEmit": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "target": "ESNext",
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "alwaysStrict": true
  },
  "include": [
    "./custom",
    "./next/universal",
    "./next/pages"
  ],
  "exclude": [
    "node_modules",
    "babel.config.js",
    "metro.config.js",
    "jest.config.js"
  ],
  "extends": "expo/tsconfig.base"
}
❯ cat test.ts

const obj = Object.freeze({name: 'Elsa', score: 157});
obj.name = 'aaa'
❯ tsx test.ts

This passes. I would however expect an error.

If i manually add a use strict to the top of the ts file then it will crash as expected

❯ cat test.ts
'use strict'
const obj = Object.freeze({name: 'Elsa', score: 157});
obj.name = 'aaa'
❯ tsx test.ts
obj.name = 'aaa'
    ^

TypeError: Cannot assign to read only property 'name' of object '#<Object>'
    at Object.<anonymous> (.../test.ts:3:5)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.m (/Users/tony/.nvm/versions/node/v16.13.1/lib/node_modules/tsx/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:536)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:190:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
    at async loadESM (node:internal/process/esm_loader:88:5)

Environment

System:
    OS: macOS 12.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 2.34 GB / 64.00 GB
    Shell: 3.5.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.1/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Ability to pass `exclude` flag to `watch`

Feature request

Add ability to pass exclude flag to watch

Why?

When tsx is used on a script that creates its dependencies, exclude option is required to ignore updates from the specified list of files.

Alternatives

Wrapping tsx with nodemon --exec 'tsx ...'

Additional context

No response

Types are loadable from referenced project but code is not

Bug description

When I run this:

import { test } from 'src/util/some-module'
console.log(test())

I get

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'src' imported from ...elided.../scripts/src/some-utility/main.ts
    at __node_internal_captureLargerStackTrace (node:internal/errors:465:5)
    at new NodeError (node:internal/errors:372:5)
    at packageResolve (node:internal/modules/esm/resolve:908:9)
    at moduleResolve (node:internal/modules/esm/resolve:957:20)
    at defaultResolve (node:internal/modules/esm/resolve:1173:11)
    at u (file://...elided.../scripts/src/some-utility/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:2362)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async J (file://...elided.../scripts/src/some-utility/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:1584)
    at async u (file://...elided.../scripts/src/some-utility/node_modules/@esbuild-kit/esm-loader/dist/index.js:1:2512)
    at async ESMLoader.resolve (node:internal/modules/esm/loader:604:24)
    at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:7)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:82:21)
    at async Promise.all (index 0)
    at async link (node:internal/modules/esm/module_job:87:9) {
  code: 'ERR_MODULE_NOT_FOUND'

I can import types from src but actual code fails to load for whatever reason. Running tsc for type checking passes but eslint complains so maybe this is something weird with my TSC & not specific to tsx? I'm at a loss though.

...elided.../scripts/src/some-utility/main.ts
  4:13  error  Unsafe call of an `any` typed value  @typescript-eslint/no-unsafe-call

Reproduction

I have the following (simplified) directory layout:

src/
   tsconfig.json
   project/api.ts
   util/some-module.ts
scripts/src/some-utility
   tsconfig.json
   main.ts

All the source in the project is TypeScript using ESM modules. The tsconfig for some-utility looks like this:

{
  "extends": "../tsconfig.json",
  "references": [{ "path": "../../../src" }],
}

The referenced tsconfig is:

{
  "compilerOptions": {
    "target": "esnext",
    "lib": ["esnext"],
    "alwaysStrict": true,
    "strict": true,
    "noEmitOnError": true,
    "module": "esnext",
    "moduleResolution": "node",
    "outDir": "./../../tscOutDir",
    "esModuleInterop": true,
    "types": ["@types/node"],
    "sourceMap": true,
    "paths": {
      "src/*": ["./../../src/*"]
    }
  }
}

src/tsconfig is as follows:

{
  "extends": "../tsconfig.json",
  "include": ["./**/*"],
  "compilerOptions": {
    "composite": true,
    "types": ["@cloudflare/workers-types"]
  }
}

The tsconfig it inherits is:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "src/*": ["./src/*"],
      "testing/*": ["./testing/*"]
    },
    "target": "esnext",
    "lib": ["esnext"],
    "alwaysStrict": true,
    "strict": true,
    "noEmitOnError": true,
    "moduleResolution": "node",
    "outDir": "tscOutDir",
    "preserveConstEnums": true,
    "esModuleInterop": true
  }
}

Environment

System:
    OS: Linux 5.16 Arch Linux
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 3.54 GB / 31.07 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 17.9.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.5.5 - /usr/bin/npm
  npmPackages:
    tsx: ^3.4.3 => 3.4.3

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

[Bug?]: chain loader

Bug description

ENOTDIR when using tsx under

  • node:18.7.0 which support chaining loader
  • yarn pnp

https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2022-07-13-version-1860-current-targos

nodejs/node#42623

Reproduction

$ yarn tsx foobar.ts
node:fs:1596
  handleErrorFromBinding(ctx);
  ^

Error: ENOTDIR: not a directory, stat '/app/.yarn/cache/tsx-npm-3.8.0-0fd68bdcc5-2990425ad0.zip/node_modules/tsx/dist/loader.js'
  errno: -20,
  syscall: 'stat',
  code: 'ENOTDIR',
  path: '/app/.yarn/cache/tsx-npm-3.8.0-0fd68bdcc5-2990425ad0.zip/node_modules/tsx/dist/loader.js'
}

Node.js v18.7.0

Environment

System:
  OS:
  CPU:
  Shell:
Binaries:
  Node: v18.7.0
  npm:
npmPackages:
  tsx:

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Support API JavaScript

Hi,

I think it would be great to have a JavaScript API for other compilers to use like tsup

Like it:

import { build } from "tsx"

build({
  entry: "src/main.ts",
  watch: true
})

View generated JS to aid in debugging

Feature request

An option flag or environment variable that causes tsx to print the path to the generated JS code before executing.

Why?

I would like to be able to view the generated JS code to assist debugging. I know it is cached in $TMPDIR, so tsx could print the path to help finding it.

Alternatives

Alternatively, an option to dump the generated code straight to stdout/stderr before running.

Or maybe debugging options I have missed?

Or I could just compile my code directly using esbuild/tsc for debugging. But knowing exactly what code tsx is producing is useful, in case the result of using esbuild/tsc is not the same for whatever reason (different version, different config, etc.).

Additional context

Debugging is difficult due to error stack traces referencing generated JS, not the source. Have I missed something? I have tried enabling sourceMaps in tsconfig but still don't seem to be getting useful error stack traces. (I guess stack traces is a separate issue)
Thank you.

Top-level await file as ES module crash.

Bug description

A typescript file include top-level await an ES module.

In this case, it may break and crash, which is irregular.

The same code works fine in ubuntu、kali and windows.

But the typescript code after build runs fine in MacOS.

node --no-warnings --experimental-vm-modules --experimental-specifier-resolution=node --experimental-wasm-modules dist/main.js

Use ts-node runs fine on MacOS.

Reproduction

tsx

Environment

System:
  OS:MacOS version: 13.0 Beta (22A5266r).
  CPU:M1
  Shell:zsh
Binaries:
  Node: v18.3.0、v18.4.0.
  npm:8.12.1
npmPackages:
  tsx:3.5.0

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

pnpm failed to install tsx

ENOENT  ENOENT: no such file or directory, copyfile '/Users/shuiluo/Library/pnpm/store/v3/files/35/760ee16f278b22518ce1ba0b25715f07b3fdfe4bfebc6e2002edd360f74932d6e4b24e9184bcaf3762f621f0accb1cc44c0b3752d6c254b8af213f71276359-exec' -> '/Users/shuiluo/Documents/vite3-react-next/node_modules/.pnpm/[email protected]/node_modules/_tmp_970_9cb6b07e2d9d0b10176a126bde7a8a35/node_modules/.bin/esbuild'

Only this dependency is problematic

It is OK to install esbuild separately

pnpm 7.1.8

node 16

Add `clearScreen` in watch mode

I have a monorepo setup, and I am using a command to parallelly run my server and client.
Server uses tsx watch to run and when they both run, tsx clears the console, so client's output is also being cleared, which is not the desired behavior.

TS files in dependency require explicit .ts extension

I have the following:

scripts/
  program/
    package.json
    main.ts
  common/
    module.ts <-- exports someMethod

In my main.ts I have:

import { someMethod } from 'common/module'

This fails with

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../scripts/program/node_modules/common/module' imported from .../scripts/program/main.ts
Did you mean to import .../scripts/common/module.ts?

If I do:

import { someMethod } from 'common/module.ts'

then it works but VSCode is unhappy & highlights this as an error.

This mostly works with esbuild-node-loader without needing to do this.

Weird import default error

Bug description

When utilizing the @tensorflow-models/universal-sentence-encoder npm package, we experienced a weird bug that went unnoticed until deployment to production. We utilized esmo by @antfu for all local dev development on a typescript express api.

Using: import use from '@tensorflow-models/universal-sentence-encoder' in our script worked perfectly locally. After building (ts->cjs/esm) and deploying to production, we got errors essentially saying many of the module functions were undefined.

After messing with it, we discovered that updating the import statement to:
import * as use from '@tensorflow-models/universal-sentence-encoder'
fixed the issue both when running uncompiled ts from the cli and post-build js in our production environment.

I'm not familiar enough with the build process ts->cjs/esm to understand the details of what could cause this. However, on the face of it, it does seem to me that if an import would fail post-compile, then tsx should fail too.

Reproduction

  1. Build a test script that utilized import use from '@tensorflow-models/universal-sentence-encoder'
  2. Build ts code using tsc -p ./tsconfig.json
  3. Try to load the model: model = await use.load() in the resulting code
  4. `...undefined (reading 'load')
  5. Update import = import * as use from '@tensorflow-models/universal-sentence-encoder'
  6. repeat steps 2-3. Works.

Environment

System:
    OS: macOS 12.3.1
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 1.11 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    npm: 8.16.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Packages:
├── @aws-sdk/[email protected]
├── @datadog/[email protected]
├── @sentry/[email protected]
├── @sentry/[email protected]
├── @tensorflow-models/[email protected]
├── @tensorflow/[email protected]
├── @tsconfig/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @typescript-eslint/[email protected]
├── @typescript-eslint/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Does not resolve .tsx files as .js

Bug description

A file at ./file.tsx should be importable in TS as ./file.js or ./file.jsx, but tsx does not support either.

Reproduction

git clone https://github.com/itsMapleLeaf/tsx-tsx-bug
cd tsx-tsx-bug
pnpm install
pnpm start

Environment

  System:
    OS: Linux 5.18 undefined
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 6.81 GB / 15.57 GB
    Container: Yes
    Shell: 3.5.1 - /usr/bin/fish
  Binaries:
    Node: 16.16.0 - /run/user/1000/fnm_multishells/189947_1659900686059/bin/node
    Yarn: 1.22.19 - ~/.local/share/pnpm/yarn
    npm: 8.11.0 - /run/user/1000/fnm_multishells/189947_1659900686059/bin/npm
  npmPackages:
    tsx: ^3.8.0 => 3.8.0

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Webpack Terser error compiling scss -> f is not defined

Bug description

We cannot use tsx to compile our scss using webpack (using ts-node same webpack configuration works correctly)

Reproduction

Here is a simple repo to reproduce the issue:

https://github.com/meriturva/tsx-webpack-terser-issue

run two scripts on package.json file (one using ts-node, the other using tsx).

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 11.28 GB / 31.72 GB
  Binaries:
    Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    tsx: 3.8.2 => 3.8.2

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

Type strictness not enforced

Bug description

When running typescript files with tsx, type strictness is not enforced.

This might be intentional, in which case, consider this bug report a feature request. I would like to be able to specify type strictness when compiling/using tsx.

Here is a minimal recreation of the bug/lacking feature:
https://github.com/GeorgesOatesLarsen/tsx-bug-demo

Notice the obvious type mismatch in bug.ts:

let x : number = "This shouldn't work...";
console.log(x);

It just flat out shouldn't compile by my estimate.

Reproduction

Clone https://github.com/GeorgesOatesLarsen/tsx-bug-demo

Then run npm install

then run npx tsx bug.ts

Environment

Running on Windows 10. No interfering global installs AFAIK.

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.

importing ts files with js extension does not work

a.ts

import './b.js' 

b.ts

console.log('hello from imported')

tsx a.ts results in an error that b.js cannot be found.

Expected behavior:
Resolve and transpile b.ts when importing as b.js

Additional info:
similar issue that was resolved in vite repo: vitejs/vite#6671
info in typescript repo why this is expected to work: microsoft/TypeScript#46452

This used to work in esmo, discovered it didn't when switching to tsx in vite-ecosystem-ci, workaround was to use b.ts instead for importing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.