Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mrm

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mrm

Simplistic project dotfiles organizer

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30K
decreased by-9.99%
Maintainers
1
Weekly downloads
 
Created
Source

Marmot (mrm)

Build Status npm

Command line tool to help you keep configuration (package.json, .gitignore, .eslintrc, etc.) of your open source projects in sync.

Features

  • Will not overwrite your data if you don’t want it to
  • Has tools to work with JSON, YAML, INI, Markdown and text files
  • Has bunch of customizable tasks
  • Easy to write your own tasks

Motivation

Most of the available tools are template based. Template approach works moderately well for new project generation but doesn’t work well for updating. Marmot’s approach is closer to codemods than templates.

Installation

npm install -g mrm

Usage

Print a list available of tasks:

mrm

Run a task or an alias

mrm gitignore
mrm license

Run multiple tasks:

mrm gitignore license

Override config options (or run without a config file):

mrm license --config:name "Gandalf the Grey" --config:email "gandalf@middleearth.com" --config:url "http://middleearth.com"

Custom config and tasks folder:

mrm license --dir ~/unicorn

Usage via npx

If you have npm 5.3 or newer you can use mrm without installation:

npx mrm
npx mrm gitignore
npx mrm license --config:name "Gandalf the Grey" --config:email "gandalf@middleearth.com" --config:url "http://middleearth.com"

Configuration

Create ~/.mrm/config.json or ~/dotfiles/mrm/config.json:

{
    "name": "Gandalf the Grey",
    "email": "gandalf@middleearth.com",
    "url": "http://middleearth.com",
    "github": "gandalf",
    "indent": "tab", // "tab" or number of spaces
    "readme": "Readme.md", // Name of readme file
    "license": "License.md", // Name of license file
    "aliases": {  // Aliases to run multiple tasks at once
        "node": ["license", "readme", "package", "editorconfig", "eslint", "gitignore"]
    }
}

Config file isn’t required, you can also pass config options via command line.

Tasks

codecov

Adds Codecov to Travis CI config (see travis task) and Readme badge.

editorconfig

EditorConfig: adds .editorconfig.

Config options:

  • indent — indentation, tab or number of spaces (by default tab).

eslint

ESLint: adds .eslintrc, adds npm script and installs dependencies.

Config options:

  • eslintPreset — preset name (not npm package name, by default will install eslint:recommended preset)
  • eslintPeerDependencies — additional dependencies to install (e.g. ['prettier', 'eslint-plugin-prettier'])

gitignore

Adds .gitignore with node_modules, logs and artifacts of popular code editors.

jest

Jest: adds npm scripts, updates .gitignore, .npmignore, .eslintignore with common patterns, installs dependencies. Tries to get rid of Mocha and AVA configs.

license

Adds license file based on license field in package.json.

Config options:

  • license — File name (by default License.md).

lintstaged

lint-staged: creates config in package.json, sets up pre-commit Git hook and installs dependencies.

package

Creates package.json.

readme

Creates Readme file.

Config options:

  • readme — Name of the readme file (by default Readme.md).

styleguidist

React Styleguidist: adds style guide config, adds npm scripts and installs dependencies.

stylelint

Stylelint: adds .stylelintrc, adds npm script and installs dependencies.

Config options:

  • stylelintPreset — preset name (by default will install stylelint-config-standard preset)
  • stylelintExtensions — file extensions to lint (by default .css)

travis

Travis CI: creates .travis.yml and adds Travis CI badge to Readme.

typescript

TypeScript: adds tsconfig.json and installs dependencies.

Custom tasks

Create either ~/.mrm/<taskname>/index.js or ~/dotfiles/mrm/<taskname>/index.js. If <taskname> is the same as one of the internal tasks your task will override an internal one.

const { /* ... */ } = require('mrm-core');
module.exports = function(config, argv) {
  config.require('name', 'email') // Mark config values as required
  // config('name') - config value
  // config('name', 'default value') - config value with a default value
  // argv - command line arguments
};
module.exports.description = 'Task description';

If your custom tasks have dependencies (such as mrm-core) you should initialize the mrm folder as an npm module and list your dependencies there:

cd ~/.mrm # or cd ~/dotfiles/mrm
npm init -y
npm install --save mrm-core

mrm-core is an utility library created to write Mrm tasks, it has function to work with common config files (JSON, YAML, INI, Markdown), npm dependencies, etc.

You can find some examples here or check code of internal tasks.

Change log

The change log can be found on the Releases page.

Contributing

Everyone is welcome to contribute. Please take a moment to review the contributing guidelines.

Authors and license

Artem Sapegin and contributors.

MIT License, see the included License.md file.

Keywords

FAQs

Package last updated on 17 Aug 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc