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

re-start

v1.14.8

Published

Start preset with reconfigurable tasks

Downloads

96

Readme

re-start

npm linux build windows build deps

js-semistandard-style Commitizen friendly semantic-release

⚙️ Configurable Start preset

Install

npm install --save-dev re-start
# or
yarn add --dev re-start

Usage

See documentation and source tasks file for details.

Default (ES6)

// package.json
"scripts": {
  "start": "start-runner --preset re-start"
}

Included Presets

  • typescript:
    • bundle - start-webpack
    • compile - start-typescript
    • test - start-mocha
    • instrument & report - start-istanbul
    • lint - currently unsupported
  • es6:
    • bundle - start-webpack
    • compile - babel
    • test - start-mocha
    • instrument & report - start-istanbul
    • lint - eslint
  • es5:
    • bundle - start-webpack
    • test - start-mocha
    • instrument & report - start-istanbul
    • lint - eslint

Example:

// package.json
"scripts": {
  "start": "start-runner --preset re-start/presets/typescript"
}

Configuration

  • reporter - the reporter to use. default: start-pretty-reporter

tasks

  • lint - the lint task. default: start-eslint
  • bundle - the bundle task. default: start-webpack
  • compile - the compile task. default: start-babel
  • test - the test test. default: start-mocha
  • instrument - the coverage instrumentation task. default: start-istanbul.instrument
  • report - the coverage reporting task. default: start-istanbul.report
  • exportCoverage - the task to export coverage reports. default: start-codecov

options

  • reporterOpts - opts passed to the reporter
  • releaseOpts - opts passed to start-release
  • lintOpts - opts passed to the lint task
  • compileOpts - opts passed to the compile task
  • testCompileOpts - opts passed to the compile task during test (typecript)
  • testOpts - opts passed to the test task
  • instrumentOpts - opts passed to the instrument task. default: { esModules: true }
  • reportOpts - opts passed to the reporting task. default: [ 'lcovonly', 'html', 'text-summary' ]
  • exportCoverageOpts - opts passed to the coverage export task

files

  • srcFiles - source file glob or glob array. default: 'src/**/*.js'
  • testFiles - test file glob or glob array. default: 'test/**/*.js'
  • lintFiles - files to read for lint command. default: [...srcFiles, ...testFiles]
  • coverageFiles - files to instrument with instrument task. default: srcFiles
  • watchFiles - files to watch for dev command. default: srcFiles
  • testWatchFiles - files to watch for tdd command. default: [...srcFiles, ...testFiles]
  • reportDir - directory for coverage reports. default: 'coverage/'
  • outDir - directory for compiled code. default: 'dist/'
  • bundleDir - directory for bundled code. default: 'bundle/'
  • coverageReport - coverage report file. default: 'coverage/lcov.info'

files (typescript-specific)

  • srcFiles - source file glob or glob array. default: 'src/index.ts'
  • testFiles - test file glob or glob array. default: 'test/**/*.ts'
  • scratchTestFiles - compiled test file glob or glob array. default: '.scratch/test/**/*.js'
  • lintFiles - files to read for lint command. default: ['src/**/*.ts', 'test/**/*.ts']
  • coverageFiles - files to instrument with instrument task. default: '.scratch/src/**/*.js'
  • watchFiles - files to watch for dev command. default: 'src/**/*.ts'
  • testWatchFiles - files to watch for tdd command. default: ['src/**/*.ts', 'test/**/*.ts']
  • scratchDir - directory for compiled code for test. default: '.scratch/'

Customized

// tasks.js
import { restart } from 're-start';
import tape from 'start-tape';
import tapSpec from 'tap-spec';

module.exports = restart({ testOpts: tapSpec, test: tape });


// package.json
"scripts": {
  "start": "start-runner --preset tasks.js"
}

or put the configuration in your package.json

// package.json
"config": {
  "restart": {
    "lintOpts": "semistandard"
  }
}

or pass your configuration with your command

npm start build -- -- --lintOpts semistandard

Hijack a command

Want to override a single command without having to repeat existing depending workflows? Re-start commands target the references in the exported module, so you can simply replace the whole lint phase with it's inherent ties to ci and prepush with little more than the following:

import { restart } from 're-start';
import env from 'start-env';
import files from 'start-files';
import eslint from 'start-eslint';

const commands = module.exports = restart();

commands.lint = () => commands.start(
  env('NODE_ENV', 'lint'),
  files('test/**/*.js'),
  eslint()
);

Available commands

  • build * - [ENV: production] in(srcFiles) -> compile() -> out(outDir) -> postBuild()
  • postBuild * - in(copyFiles) -> out(copyDiroroutDir)
  • dev * - [ENV: development] in(watchFilesorsrcFiles) -> watch(compile() -> postBuild()) -> out(outDir)
  • bundle - [ENV: development] in(srcFiles) -> bundle() -> out(bundleDir)
  • bundle:prod - [ENV: production] in(srcFiles) -> bundle() -> out(bundleDir)
  • bundle:watch - [ENV: development] in(srcFiles) -> watch(bundle())
  • bundle:watch:prod - [ENV: production] in(srcFiles) -> watch(bundle())
  • lint - [ENV: test] in(lintFilesorsrcFiles + testFiles) -> lint()
  • test - [ENV: test] in(testFiles) -> test()
  • tdd - [ENV: test] in(testWatchFilesortestFiles) -> watch(test)
  • coverage - [ENV: test] in(coverageFilesorsrcFiles) -> instrument() -> test -> report()
  • ci - [ENV: test] lint -> coverage -> in(coverageReport) -> exportCoverage()
  • prepush -> [ENV: test] lint -> coverage
  • release -> [ENV: production] release()

* not available with the es5 preset

Extend

Examples of extending a preset.