Socket
Socket
Sign inDemoInstall

sucrase

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sucrase - npm Package Compare versions

Comparing version 3.27.0 to 3.28.0

ts-node-plugin/index.js

2

dist/esm/index.js

@@ -33,3 +33,3 @@ import CJSImportProcessor from "./CJSImportProcessor";

export function getVersion() {
return "3.27.0";
return "3.28.0";
}

@@ -36,0 +36,0 @@

@@ -33,3 +33,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _CJSImportProcessor = require('./CJSImportProcessor'); var _CJSImportProcessor2 = _interopRequireDefault(_CJSImportProcessor);

function getVersion() {
return "3.27.0";
return "3.28.0";
} exports.getVersion = getVersion;

@@ -36,0 +36,0 @@

{
"name": "sucrase",
"version": "3.27.0",
"version": "3.28.0",
"description": "Super-fast alternative to Babel for when you can target modern JS runtimes",

@@ -30,2 +30,3 @@ "author": "Alan Pierce <alangpierce@gmail.com>",

"test-only": "mocha './test/**/*.ts'",
"integration-test": "cd integration-test && yarn && mocha --delay --timeout 10000 ./integration-tests.ts",
"test262": "sucrase-node spec-compliance-tests/test262/run-test262.ts",

@@ -67,3 +68,3 @@ "check-babel-tests": "sucrase-node spec-compliance-tests/babel-tests/check-babel-tests.ts",

"prettier": "^2.6.2",
"sucrase": "^3.26.0",
"sucrase": "^3.27.0",
"test262-harness": "^10.0.0",

@@ -85,4 +86,4 @@ "ts-interface-builder": "^0.3.3",

"resolutions": {
"**/eshost/socket.io": "^2"
"**/eshost/socket.io": "^4"
}
}

@@ -9,4 +9,20 @@ # Sucrase

### [Try it out](https://sucrase.io)
## [Try it out](https://sucrase.io)
## Quick usage
```bash
yarn add --dev sucrase # Or npm install --save-dev sucrase
node -r sucrase/register main.ts
```
Using the [ts-node](https://github.com/TypeStrong/ts-node) integration:
```bash
yarn add --dev sucrase ts-node typescript
./node_modules/.bin/ts-node --transpiler sucrase/ts-node-plugin main.ts
```
## Project overview
Sucrase is an alternative to Babel that allows super-fast development builds.

@@ -154,32 +170,29 @@ Instead of compiling a large range of JS features to be able to work in Internet

Installation:
### Tool integrations
```bash
yarn add --dev sucrase # Or npm install --save-dev sucrase
```
* [Webpack](https://github.com/alangpierce/sucrase/tree/main/integrations/webpack-loader)
* [Gulp](https://github.com/alangpierce/sucrase/tree/main/integrations/gulp-plugin)
* [Jest](https://github.com/alangpierce/sucrase/tree/main/integrations/jest-plugin)
* [Rollup](https://github.com/rollup/plugins/tree/master/packages/sucrase)
* [Broccoli](https://github.com/stefanpenner/broccoli-sucrase)
Often, you'll want to use one of the build tool integrations:
[Webpack](https://github.com/alangpierce/sucrase/tree/main/integrations/webpack-loader),
[Gulp](https://github.com/alangpierce/sucrase/tree/main/integrations/gulp-plugin),
[Jest](https://github.com/alangpierce/sucrase/tree/main/integrations/jest-plugin),
[Rollup](https://github.com/rollup/plugins/tree/master/packages/sucrase),
[Broccoli](https://github.com/stefanpenner/broccoli-sucrase).
### Usage in Node
Compile on-the-fly via a require hook with some [reasonable defaults](src/register.ts):
```js
// Register just one extension.
require("sucrase/register/ts");
// Or register all at once.
require("sucrase/register");
The most robust way is to use the Sucrase plugin for [ts-node](https://github.com/TypeStrong/ts-node),
which has various Node integrations and configures Sucrase via `tsconfig.json`:
```bash
ts-node --transpiler sucrase/ts-node-plugin
```
Compile on-the-fly via a drop-in replacement for node:
For projects that don't target ESM, Sucrase also has a require hook with some
reasonable defaults that can be accessed in a few ways:
```bash
sucrase-node index.ts
```
* From code: `require("sucrase/register");`
* When invoking Node: `node -r sucrase/register main.ts`
* As a separate binary: `sucrase-node main.ts`
Run on a directory:
### Compiling a project to JS
For simple use cases, Sucrase comes with a `sucrase` CLI that mirrors your
directory structure to an output directory:
```bash

@@ -189,4 +202,6 @@ sucrase ./srcDir -d ./outDir --transforms typescript,imports

Call from JS directly:
### Usage from code
For any advanced use cases, Sucrase can be called from JS directly:
```js

@@ -193,0 +208,0 @@ import {transform} from "sucrase";

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc