node package manager


The API framework for nodejs.

✨ Magnet

A productive web framework that does not compromise speed, simplicity and maintainability
Travis CI Coverage codebeat badge Npm License

Getting started

$ npm install -g magnet

Generate a boilerplate project like this:

$ magnet generate myproject

After that magnet will generate a boilerplate project creating a folder myproject.

Enter the directory myproject and run:

$ npm run

Go to http://localhost:3000:

It Works

So far, we get:

  • Automatic transpilation and bundling (with webpack and babel)
  • Static file serving. ./static/ is mapped to /static/
  • Configurable with a magnet.config.js file
  • Error middleware.
  • Code splitting via webpack.
  • Express.js support for routing.

Production deployment

To deploy your application, you just need to define the command start and magnet will serve your application using the port defined in your configuration.

For example, to deploy with now a package.json like follows is recommended:

  "name": "myproject",
  "dependencies": {
    "magnet": "latest"
  "scripts": {
    "dev": "magnet",
    "start": "magnet start"

Then run npm run start and enjoy!

Note: we recommend putting .magnet in .npmignore or .gitignore.


If you need examples of magnet usage, you can access othe examples on its repository folder.


BSD License © Liferay, Inc.