Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@swc-node/core

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swc-node/core - npm Package Compare versions

Comparing version 0.7.6 to 1.0.0

9

lib/index.d.ts
export interface Options {
target?: 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020';
target?: 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019';
module?: 'commonjs' | 'umd' | 'amd' | 'es6';

@@ -11,5 +11,4 @@ sourcemap?: boolean | 'inline';

}
export declare function transformSync(source: string, path: string, options?: Options): any;
export declare function transformJest(source: string, path: string, options?: Options): any;
export declare function transform(source: string, path: string, options?: Options): any;
export declare const SWC_VERSION = "4d5a0da";
export declare function transformSync(source: string, path: string, options?: Options): import("@swc/core").Output;
export declare function transformJest(source: string, path: string, options?: Options): import("@swc/core").Output;
export declare function transform(source: string, path: string, options?: Options): Promise<import("@swc/core").Output>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SWC_VERSION = exports.transform = exports.transformJest = exports.transformSync = void 0;
const path_1 = require("path");
const helper_1 = require("@node-rs/helper");
const bindings = helper_1.loadBinding(path_1.join(require.resolve('@swc-node/core'), '..', '..'), 'swc', '@swc-node/core');
function transformOption(path, options) {
var _a, _b, _c;
exports.transform = exports.transformJest = exports.transformSync = void 0;
const core_1 = require("@swc/core");
function transformOption(path, options, jest = false) {
var _a, _b;
const opts = options == null ? {} : options;
opts.esModuleInterop = (_a = opts.esModuleInterop) !== null && _a !== void 0 ? _a : true;
return JSON.stringify({
return {
filename: path,

@@ -24,7 +22,11 @@ jsc: {

decoratorMetadata: Boolean(opts.emitDecoratorMetadata),
hidden: {
jest,
},
},
},
minify: false,
isModule: true,
module: {
type: (_c = opts.module) !== null && _c !== void 0 ? _c : 'commonjs',
type: 'commonjs',
noInterop: !opts.esModuleInterop,

@@ -34,17 +36,16 @@ },

swcrc: false,
});
};
}
function transformSync(source, path, options) {
return bindings.transformSync(source, path, transformOption(path, options));
return core_1.transformSync(source, transformOption(path, options));
}
exports.transformSync = transformSync;
function transformJest(source, path, options) {
return bindings.transformJest(source, path, transformOption(path, options));
return core_1.transformSync(source, transformOption(path, options, true));
}
exports.transformJest = transformJest;
function transform(source, path, options) {
return bindings.transform(source, path, transformOption(path, options));
return core_1.transform(source, transformOption(path, options));
}
exports.transform = transform;
exports.SWC_VERSION = '4d5a0da';
//# sourceMappingURL=index.js.map
{
"name": "@swc-node/core",
"version": "0.7.6",
"version": "1.0.0",
"description": "Faster swc nodejs binding",

@@ -37,8 +37,2 @@ "keywords": [

],
"napi": {
"name": "swc",
"musl": [
"linux"
]
},
"engines": {

@@ -58,15 +52,6 @@ "node": ">= 8.9"

},
"scripts": {
"prepublishOnly": "napi prepublish",
"version": "napi version"
},
"dependencies": {
"@node-rs/helper": "^0.4.0"
"@swc/core": "^1.2.34"
},
"gitHead": "318f7dfefadc8b3b9143bc5ee22211863ee46bc0",
"optionalDependencies": {
"@swc-node/core-darwin": "^0.7.6",
"@swc-node/core-linux": "^0.7.6",
"@swc-node/core-win32": "^0.7.6"
}
}
"gitHead": "79c77f87bbab8b96f1306679cbb5c49368f94777"
}

Sorry, the diff of this file is not supported yet

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