
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@netlify/build
Advanced tools
@netlify/build is a Node.js library that allows you to programmatically run Netlify Build plugins. It provides a way to automate and customize the build process for Netlify sites, enabling you to extend and modify the default behavior of Netlify's build system.
Running Build Plugins
This feature allows you to run Netlify Build plugins programmatically. The code sample demonstrates how to configure and run a build with a specific plugin and environment settings.
const { build } = require('@netlify/build');
(async () => {
const result = await build({
config: {
build: {
publish: 'dist',
environment: {
NODE_ENV: 'production'
}
},
plugins: [
{
package: '@netlify/plugin-example',
inputs: {
exampleInput: 'value'
}
}
]
}
});
console.log(result);
})();
Custom Build Configuration
This feature allows you to customize the build configuration, such as specifying the publish directory and build command. The code sample shows how to set a custom build command and publish directory.
const { build } = require('@netlify/build');
(async () => {
const result = await build({
config: {
build: {
publish: 'public',
command: 'npm run build'
}
}
});
console.log(result);
})();
Handling Build Events
This feature allows you to handle build events such as success and error. The code sample demonstrates how to log messages based on the build outcome.
const { build } = require('@netlify/build');
(async () => {
const result = await build({
config: {
build: {
publish: 'dist'
}
},
events: {
onSuccess: () => {
console.log('Build succeeded!');
},
onError: (error) => {
console.error('Build failed:', error);
}
}
});
})();
Gulp is a toolkit for automating painful or time-consuming tasks in your development workflow. It is similar to @netlify/build in that it allows you to define and run build tasks, but it is more general-purpose and not specifically tied to Netlify.
Grunt is a JavaScript task runner that helps automate repetitive tasks like minification, compilation, unit testing, and linting. Like @netlify/build, it can be used to manage build processes, but it is not specific to Netlify and offers a broader range of task automation.
Webpack is a module bundler for JavaScript applications. It takes modules with dependencies and generates static assets representing those modules. While @netlify/build focuses on running Netlify-specific build plugins, Webpack is more about bundling and optimizing assets for web applications.
FAQs
Netlify build module
The npm package @netlify/build receives a total of 118,574 weekly downloads. As such, @netlify/build popularity was classified as popular.
We found that @netlify/build demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 16 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.