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

mrm-core

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mrm-core

Utilities to make tasks for mrm

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54K
increased by6.85%
Maintainers
1
Weekly downloads
 
Created
Source

Marmot (mrm) core utils

npm

Utilities to make tasks for mrm.

Taks example

This task adds ESLint to your project:

'use strict';

const { json, lines, install } = require('mrm-core');

const defaultTest = 'echo "Error: no test specified" && exit 1';
const packages = [
	'eslint',
	'eslint-config-tamia',
];

module.exports = function() {
	// .eslintrc
	const eslintrc = json('.eslintrc');
	if (!eslintrc.get('extends').startsWith('tamia')) {
		eslintrc
			.set('extends', 'tamia')
			.save()
		;
	}

	// .eslintignore
	const eslintignore = lines('.eslintignore');
	eslintignore
		.append('node_modules')
		.save()
	;

	// package.json
	const packageJson = json('package.json')
		.merge({
			scripts: {
				lint: 'eslint . --ext .js --fix',
			},
		})
	;

	// package.json: test command
	const test = packageJson.get('scripts.test');
	if (!test || test === defaultTest) {
		packageJson.set('scripts.test', 'npm run lint');
	}
	else if (!test.includes('lint')) {
		packageJson.set('scripts.test', `npm run lint && ${test}`);
	}

	packageJson.save();

	// package.json: dependencies
	if (!packageJson.get('dependencies.eslint-config-tamia')) {
		install(packages);
	}
};
module.exports.description = 'Adds ESLint with a custom preset';

Read more in mrm’s docs, and this talks is already included by default.

You can find more examples here.

Installation

npm install --save-dev mrm-core

API

const { ini, json, lines, markdown, template, yaml, install, MrmError } = require('mrm-core');
  • Modules to work with files of different formats: ini, json, lines, markdown, template, yaml.
  • Install Yarn/npm packages: install.
  • Custom error class: MrmError.

Changelog

The changelog 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 20 Jan 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