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

@frozzare/pkg

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frozzare/pkg - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

dist/utils.d.ts

4

dist/index.d.ts
import { BuildOptions as ESBuildOptions } from 'esbuild';
export type BuildOptions = Omit<ESBuildOptions, 'bundle' | 'entryPoints'>;
export declare const build: (entryPoint: string, options?: BuildOptions) => Promise<string | void>;
export declare const build: (entry: string | (BuildOptions & {
entry: string;
}), options?: BuildOptions) => Promise<string | void>;

@@ -10,14 +10,28 @@ "use strict";

const esbuild_1 = require("esbuild");
const utils_1 = require("./utils");
const defaultOptions = {
write: true,
};
const build = async (entryPoint, options = {}) => {
const config = { ...defaultOptions, ...options };
const out = await (0, esbuild_1.build)({
const build = async (entry, options = {}) => {
var _a;
const config = (0, utils_1.omit)(['entry'], {
...defaultOptions,
...(typeof entry === 'object' ? entry : options),
});
const result = await (0, esbuild_1.build)({
...config,
entryPoints: [entryPoint],
entryPoints: [typeof entry === 'string' ? entry : entry.entry],
bundle: true,
write: false,
});
const file = out.outputFiles[0];
if (result.errors.length) {
throw result.errors;
}
if (result.warnings.length) {
result.warnings.forEach(console.warn);
}
if (!((_a = result.outputFiles) === null || _a === void 0 ? void 0 : _a.length)) {
throw new Error('No outfile defined');
}
const file = result.outputFiles[0];
let text = file.text;

@@ -24,0 +38,0 @@ if (config.format === 'cjs') {

{
"name": "@frozzare/pkg",
"version": "1.0.3",
"version": "1.0.4",
"description": "",

@@ -17,2 +17,4 @@ "main": "dist/index.js",

"keywords": [],
"homepage": "https://github.com/frozzare/node-pkg",
"repository": "https://github.com/frozzare/node-pkg",
"author": "Fredrik Forsmo <fredrik.forsmo@gmail.com>",

@@ -19,0 +21,0 @@ "license": "MIT",

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