
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
@bestest/compiler
Advanced tools
Compiler part of Bestest benchmarking tool - compile your code in memory to run on different environments.
Compiler part of Bestest benchmarking tool. Use it to compile your code in memory, to run it on different environments.
This example is using Webpack adapter, and in-memory files only (although these are not required, you may have them locally).
import { Compiler } from '@bestest/compiler'
import WebpackCompilerAdapter from '@bestest/compiler-webpack'
// Set-up in-memory files
const files = [
{
filePath: './index.js',
publicPath: '/app.js',
contents: `
import file from "./abc"
console.log("test-" + file)
`
},
{
filePath: './abc.js',
publicPath: './abc.js',
contents: `
export default "value"
`
}
]
// Set-up compiler adapter
const adapter = new WebpackCompilerAdapter({
webpackConfig: {}
})
// Set-up compiler
const compiler = new Compiler('webpack-example', adapter)
// Listen for events
compiler.events.on('initialize:start', () => console.log('Initialization started'))
// compiler.events.on('initialize:end', () => console.log('Initialization end'))
compiler.events.on('initialize:success', () => console.log('Initialization succeed'))
compiler.events.on('initialize:error', () => console.log('Initialization failed'))
compiler.events.on('compile:start', () => console.log('Compilation started'))
// compiler.events.on('compile:end', () => console.log('Compilation end'))
compiler.events.on('compile:success', () => console.log('Compilation succeed'))
compiler.events.on('compile:error', () => console.log('Compilation failed'))
// Set-up compilation configuration
const config = {
entries: [ './index' ],
memoryFiles: files
}
// Compile files
compiler.initialize(error => {
if (error) {
throw new Error('There was a problem while initializing the compiler adapter.')
}
compiler.compile(config, (error, fs, entries) => {
console.log('Error ', error)
console.log('Entries', entries)
if (fs) {
console.log('Files ', fs.getLocalFilesWithContents())
}
})
})
FAQs
Compiler part of Bestest benchmarking tool - compile your code in memory to run on different environments.
The npm package @bestest/compiler receives a total of 1 weekly downloads. As such, @bestest/compiler popularity was classified as not popular.
We found that @bestest/compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.