Convert Figma logo to code with AI

neutrinojs logoneutrino

Create and build modern JavaScript projects with zero initial configuration.

3,946
214
3,946
1

Top Related Projects

Create and build modern JavaScript projects with zero initial configuration.

64,559

A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

43,380

The zero configuration build tool for the web. 📦🚀

25,227

Next-generation ES module bundler

67,112

Next generation frontend tooling. It's fast!

Quick Overview

Neutrino is a modern JavaScript build tool that simplifies the configuration of webpack for building web applications, Node.js services, and libraries. It provides a streamlined approach to setting up and managing build processes, offering pre-configured presets and middleware for various project types.

Pros

  • Simplifies webpack configuration with a high-level, declarative approach
  • Offers a wide range of pre-configured presets for different project types (React, Vue, Node.js, etc.)
  • Allows easy customization and extension through middleware
  • Provides a consistent build setup across different projects

Cons

  • Learning curve for developers unfamiliar with webpack and Neutrino's concepts
  • Limited community support compared to more established build tools
  • Some presets may not cover all edge cases or specific requirements
  • Dependency on webpack ecosystem, which may not be ideal for all projects

Code Examples

  1. Basic Neutrino configuration:
// .neutrinorc.js
module.exports = {
  use: [
    '@neutrinojs/react',
    '@neutrinojs/jest'
  ]
};

This configuration sets up a React project with Jest testing support.

  1. Custom webpack configuration:
// .neutrinorc.js
module.exports = {
  use: [
    '@neutrinojs/react',
    (neutrino) => {
      neutrino.config.module
        .rule('style')
        .use('sass-loader')
        .loader('sass-loader');
    }
  ]
};

This example adds Sass support to a React project.

  1. Using middleware:
// .neutrinorc.js
const { eslint } = require('@neutrinojs/eslint');

module.exports = {
  use: [
    '@neutrinojs/react',
    eslint({
      eslint: {
        rules: {
          'no-console': 'off'
        }
      }
    })
  ]
};

This configuration customizes ESLint rules for a React project.

Getting Started

  1. Install Neutrino and desired presets:

    npm install --save-dev neutrino @neutrinojs/react @neutrinojs/jest
    
  2. Create a .neutrinorc.js file in your project root:

    module.exports = {
      use: [
        '@neutrinojs/react',
        '@neutrinojs/jest'
      ]
    };
    
  3. Add scripts to your package.json:

    {
      "scripts": {
        "start": "neutrino start",
        "build": "neutrino build",
        "test": "neutrino test"
      }
    }
    
  4. Run your project:

    npm start
    

Competitor Comparisons

Create and build modern JavaScript projects with zero initial configuration.

Pros of Neutrino

  • More active development and maintenance
  • Larger community and ecosystem
  • Better documentation and examples

Cons of Neutrino

  • Potentially more complex setup for simple projects
  • Steeper learning curve for beginners

Code Comparison

Neutrino configuration example:

module.exports = {
  use: [
    '@neutrinojs/react',
    '@neutrinojs/jest',
    ['@neutrinojs/style-loader', { extract: true }]
  ]
};

Both repositories are actually the same project, with neutrinojs/neutrino being the main repository and neutrinojs/neutrino> likely being a typo or non-existent repository. Therefore, a direct comparison between the two is not applicable. The information provided above focuses on the characteristics of the Neutrino project itself.

Neutrino is a powerful tool for building and testing JavaScript projects, offering a modular approach to configuration. It provides a balance between simplicity and flexibility, allowing developers to create custom builds while abstracting away much of the complexity associated with tools like webpack and Babel.

The project's active development and strong community support ensure that it stays up-to-date with the latest web development trends and best practices. However, for very simple projects or developers new to build tools, the initial setup and configuration might seem overwhelming compared to more opinionated alternatives.

64,559

A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

Pros of webpack

  • Highly configurable and flexible, allowing for complex build setups
  • Extensive ecosystem with a wide range of plugins and loaders
  • Well-established and widely adopted in the industry

Cons of webpack

  • Steep learning curve, especially for beginners
  • Configuration can be complex and verbose
  • Slower build times for large projects without optimization

Code Comparison

Neutrino configuration:

module.exports = {
  use: [
    '@neutrinojs/react',
    '@neutrinojs/jest'
  ]
};

webpack configuration:

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  module: {
    rules: [
      { test: /\.js$/, use: 'babel-loader' }
    ]
  }
};

Neutrino simplifies configuration with presets, while webpack requires more explicit setup. Neutrino's approach is more concise and easier to understand for beginners, but webpack offers greater flexibility for advanced users who need fine-grained control over their build process.

43,380

The zero configuration build tool for the web. 📦🚀

Pros of Parcel

  • Zero configuration out of the box, making it easier for beginners
  • Faster build times due to its multi-core processing and caching
  • Built-in support for various file types without additional plugins

Cons of Parcel

  • Less flexibility and customization options for complex projects
  • Smaller ecosystem and community compared to Webpack-based solutions
  • May produce larger bundle sizes in some cases

Code Comparison

Parcel:

// No configuration file needed
// Just run: parcel index.html

Neutrino:

// .neutrinorc.js
module.exports = {
  use: [
    '@neutrinojs/react',
    '@neutrinojs/jest'
  ]
};

Key Differences

  • Parcel aims for simplicity and speed, while Neutrino focuses on flexibility and extensibility
  • Neutrino uses Webpack under the hood, allowing for more advanced configurations
  • Parcel has a broader built-in asset support, while Neutrino relies on presets and plugins

Use Cases

  • Parcel: Ideal for quick prototypes, small to medium-sized projects, and developers who prefer minimal configuration
  • Neutrino: Better suited for larger projects, teams with specific requirements, and those who need fine-grained control over their build process

Community and Ecosystem

  • Parcel has gained popularity due to its ease of use but has a smaller ecosystem
  • Neutrino leverages the vast Webpack ecosystem, providing access to a wide range of plugins and tools
25,227

Next-generation ES module bundler

Pros of Rollup

  • Highly efficient tree-shaking for smaller bundle sizes
  • Excellent support for ES modules and code splitting
  • Simpler configuration for straightforward projects

Cons of Rollup

  • Less suitable for complex applications with many non-ES dependencies
  • Fewer built-in features compared to Neutrino's preset system
  • Steeper learning curve for advanced configurations

Code Comparison

Rollup configuration:

export default {
  input: 'src/main.js',
  output: {
    file: 'bundle.js',
    format: 'iife'
  }
};

Neutrino configuration:

module.exports = {
  use: [
    '@neutrinojs/web',
    {
      entry: './src/index.js',
      output: 'dist'
    }
  ]
};

Rollup focuses on a more explicit configuration style, while Neutrino leverages presets for common scenarios. Rollup's approach offers fine-grained control over the bundling process, making it ideal for library authors. Neutrino, on the other hand, provides a higher-level abstraction that simplifies configuration for typical web applications.

Rollup excels in creating smaller bundles through advanced tree-shaking, particularly beneficial for libraries and smaller projects. Neutrino's strength lies in its preset system, which encapsulates best practices and reduces boilerplate for larger applications.

67,112

Next generation frontend tooling. It's fast!

Pros of Vite

  • Faster build times and hot module replacement (HMR)
  • Native ES modules support for efficient development
  • Simpler configuration and setup process

Cons of Vite

  • Less flexible for complex build configurations
  • Smaller ecosystem and community compared to Webpack-based tools
  • Limited support for older browsers without additional configuration

Code Comparison

Vite configuration:

// vite.config.js
export default {
  plugins: [react()],
  build: {
    outDir: 'dist',
  }
}

Neutrino configuration:

// .neutrinorc.js
module.exports = {
  use: [
    '@neutrinojs/react',
    {
      html: { title: 'My App' },
      devServer: { port: 5000 }
    }
  ]
};

Vite focuses on simplicity and speed, leveraging native ES modules for development. It offers a more streamlined configuration process but may be less flexible for complex build scenarios. Neutrino, built on top of Webpack, provides more customization options and a wider ecosystem but may have slower build times and a steeper learning curve. The code comparison shows the difference in configuration approaches, with Vite using a more concise and straightforward setup.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Create and build modern JavaScript applications with zero initial configuration

Neutrino combines the power of webpack with the simplicity of presets.

NPM version NPM downloads CI Status Netlify Status

https://github.com/neutrinojs/neutrino


Neutrino is a companion tool which lets you build web and Node.js applications with shared presets or configurations. It intends to make the process of initializing and building projects much simpler by providing minimal development dependencies.

Neutrino uses webpack to build both web and Node.js projects by providing complete build presets which can be shared across targets and projects. You can use Neutrino base presets to get started building a variety of projects, create your own presets by extending the Neutrino core ones to be shared across your own projects or even by the community. Presets can even be manipulated on a project-by-project basis to handle almost any build situation your preset doesn't cover.

Documentation

See the Neutrino docs for details on installation, getting started, usage, and customizing.

Contributing

Thank you for wanting to help out with Neutrino! We are very happy that you want to contribute, and have put together this guide to help you get started. We want to do our best to help you make successful contributions and be part of our community.

NPM DownloadsLast 30 Days