Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@storybook/core-server
Advanced tools
The @storybook/core-server npm package is part of the Storybook ecosystem, which is a tool for developing UI components in isolation for React, Vue, Angular, and more. It allows developers to serve and manage Storybook instances in a Node.js environment. With this package, you can start a Storybook server, build a static version of Storybook for deployment, and customize various aspects of the Storybook instance.
Starting a Storybook server
This code sample demonstrates how to start a Storybook server on port 6006 using the configuration from the '.storybook' directory.
const { buildDevStandalone } = require('@storybook/core-server');
buildDevStandalone({
port: 6006,
configDir: './.storybook'
}).catch(error => {
console.error(error);
process.exit(1);
});
Building a static Storybook
This code sample shows how to build a static version of Storybook that can be deployed to a web server. The output will be placed in the 'storybook-static' directory.
const { buildStatic } = require('@storybook/core-server');
buildStatic({
staticDir: './public',
configDir: './.storybook',
outputDir: './storybook-static'
}).catch(error => {
console.error(error);
process.exit(1);
});
Customizing Storybook's Webpack configuration
This code sample is typically placed in a '.storybook/main.js' file and demonstrates how to customize Storybook's Webpack configuration using the 'webpackFinal' method.
module.exports = {
stories: ['../src/**/*.stories.js'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
webpackFinal: async (config, { configType }) => {
// Modify or return the webpack config.
return config;
}
};
React Cosmos is a development tool for creating reusable React components. It allows developers to render components with different props and states, similar to Storybook. However, React Cosmos focuses specifically on React and does not support other frameworks.
Docz leverages MDX to help you document your things with a focus on writing and design. It's similar to Storybook in that it provides a UI for showcasing components, but it uses MDX as the primary format for stories and documentation.
FAQs
Storybook framework-agnostic API
We found that @storybook/core-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.