npm.io
1.1.7 • Published 9 years agoCLI

autorpmspec

Licence
Apache-2.0
Version
1.1.7
Deps
5
Vulns
0
Weekly
0

autorpmspec

Generate an RPM Spec from a NodeJS package

Installation

npm install --save autorpmspec

Features

  • Generates an RPM Spec
  • Creates a systemd service

Usage

npm start script

The systemd service file uses the npm start script to start your application.

{
  "scripts": {
    "start": "node server.js"
  }
}
Directory Structure

The following directories are used for your application:

Directory Purpose
/var/lib/:projectName application
/var/log/:projectName logs
the spec property inside your existing package.json file.
Dependencies

list the package dependencies in the requires array:

{
  "spec": {
    "requires": [
      "vim",
      "screen"
    ]
  }
}
{
  "spec": {
    "buildRequires": [
      "python"
    ]
  }
}
Executables

List files and directories that need to be executable:

{
  "spec": {
    "executable": [
      "./other-scripts/my-script.js",
      "./scripts"
    ]
  }
}
Scriptlet
{
  "spec": {
    "pre": [
      "echo example"
    ],
    "post": [
      "echo example"
    ],
    "preun": [
      "echo example"
    ],
    "postun": [
      "echo example"
    ]
  }
}
Environment variable

specify environment variables during startup:

{
  "spec": {
    "environment": {
      "NODE_ENV": "production",
      "NODE_INSTANCE": "%i"
    }
  }
}
Release Number

--release flag:

autorpmspec --release=7
Custom Name

--name flag:

autorpmspec --name=my-cool-api

Keywords