npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

Iโ€™ve always been into building performant and accessible sites, but lately Iโ€™ve been taking it extremely seriously. So much so that Iโ€™ve been building a tool to help me optimize and monitor the sites that I build to make sure that Iโ€™m making an attempt to offer the best experience to those who visit them. If youโ€™re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, ๐Ÿ‘‹, Iโ€™m Ryan Hefnerย  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If youโ€™re interested in other things Iโ€™m working on, follow me on Twitter or check out the open source projects Iโ€™ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soonโ€“ish.

Open Software & Tools

This site wouldnโ€™t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you ๐Ÿ™

ยฉ 2024 โ€“ย Pkg Stats / Ryan Hefner

@putout/plugin-madrun

v19.0.0

Published

๐ŸŠPutout plugin adds ability to transform madrun scripts

Downloads

66,571

Readme

@putout/plugin-madrun NPM version

CLI tool to run multiple npm-scripts in a madly comfortable way.

(c) Madrun

๐ŸŠPutout plugin adds ability to fix issues with Madrun config file.

Install

npm i putout @putout/plugin-madrun -D

Rules

  • โœ… [add-cut-env][#add-cut-env];
  • โœ… [add-fix-lint][#add-fix-lint];
  • โœ… [add-function][#add-function];
  • โœ… [add-run][#add-run];
  • โœ… [call-run][#call-run];
  • โœ… [convert-args-to-scripts][#convert-args-to-scripts];
  • โœ… [convert-cut-env-to-run][#convert-cut-env-to-run];
  • โœ… [convert-lint-lib][#convert-lint-lib];
  • โœ… [convert-nyc-to-c8][#convert-nyc-to-c8];
  • โœ… [convert-run-argument][#convert-run-argument];
  • โœ… [convert-run-to-cut-env][#convert-run-to-cut-env];
  • โœ… [convert-to-async][#convert-to-async];
  • โœ… [declare][#declare];
  • โœ… [remove-check-duplicates-from-test][#remove-check-duplicates-from-test];
  • โœ… [remove-putout][#remove-putout];
  • โœ… [remove-useless-array-in-run][#remove-useless-array-in-run];
  • โœ… [remove-useless-string-conversion][#remove-useless-string-conversion];
  • โœ… [rename-eslint-to-putout][#rename-eslint-to-putout];
  • โœ… [rename-series-to-run][#rename-series-to-run];
  • โœ… [set-lint-dot][#set-lint-dot];
  • โœ… [set-report-lcov][#set-report-lcov];

Config

{
    "rules": {
        "madrun/add-function": "on",
        "madrun/add-fix-lint": "on",
        "madrun/add-run": "on",
        "madrun/add-cut-env": "on",
        "madrun/call-run": "on",
        "madrun/convert-run-argument": "on",
        "madrun/convert-args-to-scripts": "on",
        "madrun/convert-run-to-cut-env": "on",
        "madrun/convert-cut-env-to-run": "on",
        "madrun/rename-series-to-run": "on",
        "madrun/rename-eslint-to-putout": "on",
        "madrun/set-lint-dot": "on",
        "madrun/convert-to-async": "on",
        "madrun/convert-nyc-to-c8": "on",
        "madrun/set-report-lcov": "on",
        "madrun/remove-check-duplicates-from-test": "on",
        "madrun/remove-useless-array-in-run": "on",
        "madrun/remove-useless-string-conversion": "on"
    }
}

add-function

โŒ Example of incorrect code

module.exports = {
    hello: 'world',
};

โœ… Example of correct code

module.exports = {
    hello: () => 'world',
};

add-fix-lint

โŒ Example of incorrect code

const {run} = require('madrun');

module.exports = {
    lint: 'putout lib test',
};

โœ… Example of correct code

const {run} = require('madrun');

module.exports = {
    'lint': 'putout lib test',
    'fix:lint': run('lint', '--fix'),
};

add-run

โŒ Example of incorrect code

module.exports = {
    lint: 'putout lib test',
};

โœ… Example of correct code

const {run} = require('madrun');

module.exports = {
    lint: 'putout lib test',
};

add-cut-env

โŒ Example of incorrect code

export default {
    'test': () => [env, 'test:only'],
    'test:only': () => [env, 'npm test'],
};

โœ… Example of correct code

import {cutEnv} from 'madrun';

export default {
    'test': async () => [testEnv, await cutEnv('test:only')],
    'test:only': () => [env, 'npm test'],
};

convert-run-argument

โŒ Example of incorrect code

module.exports = {
    hello: () => run(['a']),
};

โœ… Example of correct code

module.exports = {
    hello: () => run('a'),
};

convert-args-to-scripts

Check out in ๐ŸŠPutout Editor.

โŒ Example of incorrect code

export default {
    build: () => 'tsup',
    wisdom: () => run('build', 'test', 'test:dts'),
};

โœ… Example of correct code

export default {
    build: () => 'tsup',
    wisdom: () => run(['build', 'test', 'test:dts']),
};

convert-run-to-cut-env

โŒ Example of incorrect code

export default {
    'test': () => [env, 'npm test'],
    'test:only': () => 'npm test',
    'coverage': async () => [env, await run('test')],
    'coverage:only': async () => [env, await run('test:only')],
};

โœ… Example of correct code

export default {
    'test': () => [env, 'npm test'],
    'test:only': () => 'npm test',
    'coverage': async () => [env, await cutEnv('test')],
    'coverage:only': async () => [env, await run('test:only')],
};

convert-cut-env-to-run

โŒ Example of incorrect code

export default {
    'test': () => [env, 'npm test'],
    'test:only': () => 'npm test',
    'coverage': async () => [env, await cutEnv('test')],
    'coverage:only': async () => [env, await cutEnv('test:only')],
};

โœ… Example of correct code

export default {
    'test': () => [env, 'npm test'],
    'test:only': () => 'npm test',
    'coverage': async () => [env, await cutEnv('test')],
    'coverage:only': async () => [env, await run('test:only')],
};

rename-eslint-to-putout

โŒ Example of incorrect code

module.exports = {
    lint: 'eslint lib test --ignore test/fixture',
};

โœ… Example of correct code

module.exports = {
    lint: 'putout lib test',
};

set-lint-dot

โŒ Example of incorrect code

module.exports = {
    lint: 'putout lib test',
};

โœ… Example of correct code

module.exports = {
    lint: 'putout .',
};

convert-to-async

โŒ Example of incorrect code

module.exports = {
    lint: () => String(run('hello')),
};

โœ… Example of correct code

module.exports = {
    lint: async () => String(await run('hello')),
};

convert-nyc-to-c8

โŒ Example of incorrect code

export default {
    coverage: () => 'nyc npm test',
    report: () => `nyc report --reporter=text-lcov | coveralls`,
};

โœ… Example of correct code

export default {
    coverage: () => 'c8 npm test',
    report: 'c8 report --reporter=lcov',
};

set-report-lcov

โŒ Example of incorrect code

export default {
    report: () => `c8 report --reporter=text-lcov | coveralls || true`,
};

โœ… Example of correct code

export default {
    report: 'c8 report --reporter=lcov',
};

remove-check-duplicates-from-test

โŒ Example of incorrect code

export default {
    test: () => 'tape -d *.js',
};

โœ… Example of correct code

export default {
    test: () => 'tape *.js',
};

remove-useless-array-in-run

Checkout in ๐ŸŠPutout Editor.

โŒ Example of incorrect code

export default {
    time: async () => await run(['lint:fresh', '-f time']),
};

โœ… Example of correct code

export default {
    time: async () => await run('lint:fresh', '-f time'),
};

remove-useless-string-conversion

Checkout in ๐ŸŠPutout Editor.

โŒ Example of incorrect code

export default {
    time: async () => [testEnv, String(await cutEnv('test:raw'))],
};

โœ… Example of correct code

export default {
    time: async () => [testEnv, await cutEnv('test:raw')],
};

declare

โŒ Example of incorrect code

export default {
    coverage: async () => [env, `c8 ${await cutEnv('test')}`],
};

โœ… Example of correct code

import {cutEnv} from 'madrun';

export default {
    coverage: async () => [env, `c8 ${await cutEnv('test')}`],
};

License

MIT