Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@apeleghq/esbuild-plugin-inline-js
Advanced tools
npm i -D @apeleghq/esbuild-plugin-inline-js
In the file you have your configuration, first import this plugin
const inlineJs = require('@apeleghq/esbuild-plugin-inline-js');
Or using ES module syntax:
import inlineJs from '@apeleghq/esbuild-plugin-inline-js';
Then, in your esbuild configuration, add inlineJs()
to the plugins
list. inlineJs
optionally takes an object that is passed to esbuild.build
, with the exception of the following keys: entryPoints
, outdir
, outfile
and write
. Minimal example:
const esbuild = require('esbuild');
const responsiveImages = require('@apeleghq/esbuild-plugin-inline-js');
await esbuild
.build({
entryPoints: ['index.js'],
outdir: 'build',
bundle: true,
format: 'cjs',
plugins: [inlineJs()],
});
Import your inline scripts like this (the extensions supported are inline.js
, inline.jsx
, inline.ts
and inline.tsx
):
const inline = require('./foo.inline.js');
// import * as inline from './foo.inline.js';
The import will return something like this:
{
"contentBase64":
"KGZ1bmN0aW9uKCl7cmV0dXJuIkhlbGxvLCBXb3JsZCEifSkoKTsK",
"default":
"(function(){return\"Hello, World!\"})();\n",
"sri": "sha384-PKTF85dF3CsFYaS3tntysCSCAPJBKTcMWuzUmxBG0MTrEJMfMFeNSUo+KQGaqzp3"
}
FAQs
esbuild plugin for inline scripts
The npm package @apeleghq/esbuild-plugin-inline-js receives a total of 4 weekly downloads. As such, @apeleghq/esbuild-plugin-inline-js popularity was classified as not popular.
We found that @apeleghq/esbuild-plugin-inline-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.