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

pipe-builder

v0.1.1

Published

Construtor de projetos

Downloads

2

Readme

function build(buildings: Building|Building[], defaultInOutBuilding?: InOutBuilding)

Executa as construções especificadas

Exemplo 1

build([
  {
    // Caminho fonte - argumento para `gulp.src()`.
    src: ['path-to-app-lib/**/*', 'path-to-third-lib/**/*'],
    // Caminho de destino - argumento para `gulp.dest()`.
    dest: 'path-to-dest',
    // Extensão do arquivo. Quando fornecido, filtra apenas os arquivos modificados na entrada. Use '*' quando as extensões forem mistas.
    // Quando não fornecido, não haverá filtragem.
    extension: '*',
    // Uma ou mais tarefas a serem executadas nas entradas, já filtradas se 'extension' for fornecido.
    tasks: {
      // Tarefa com o identificador 'typescript' deve ser único (inclusive, entre chamadas posteriores de `build()`).
      // O valor deve ser uma função que receberá a stream retornada por Gulp e o identificador da tarefa, e deve retornar uma stream, ou
      // `null`, resultando em uma operação de cópia.
      'typescript': (stream, taskId) => stream.pipe(filter('**/*.ts')).pipe(typescript()),
      // Tarefa com o identificador 'javascript'.
      'javascript': (stream, taskId) => stream.pipe(filter('**/*.js'))
    }
  }
], {
  // Tarefas executadas antes de cada tarefa (nesse caso, antes de 'typescript' e antes de 'javascript').
  input: {
    // Executada apenas se a flag '--production' for fornecida (via linha de comando, ou modificando em `argv`).
    '--production': (stream, taskId) => stream.pipe(removeDebugFlags())
  },
  // Tarefas executadas depois de cada tarefa (nesse caso, depois de 'typescript' e depois de 'javascript').
  output: {
    // Executada apenas se a flag '--production' for fornecida (via linha de comando, ou modificando em `argv`).
    '--production': (stream, taskId) => stream.pipe(minify())
    // Executada sempre, independente das flags fornecidas.
    '--': (stream, taskId) => stream.pipe(optimizer())
  }
})

Exemplo 2

build({
  // Caminho fonte - argumento para `gulp.src()`.
  src: 'path-to-lib/**/*.js',
  // Caminho de destino - argumento para `gulp.dest()`.
  dest: 'path-to-dest',
  // Mesmo que a extensão seja sempre '.js', a propriedade `extension' deve ser fornecida para haver filtragem dos arquivos modificados.
  extension: 'js',
  // Uma ou mais tarefas a serem executadas nas entradas, já filtradas se 'extension' for fornecido.
  tasks: {
    // Tarefa com o identificador 'assemble-as-amd'.
    'assemble-as-amd': (stream, taskId) => stream.pipe(changeExtension('amd.js'))
    // Tarefa com o identificador 'assemble-as-umd'.
    'assemble-as-umd': (stream, taskId) => stream.pipe(changeExtension('umd.js'))
  }, {
    // Se houver apenas uma tarefa e não necessitar alguma flag, pode-se fronecer uma função diretamente.
    output: (stream, taskId) => stream.pipe(minify())
  }
})
const argv: Dictionary<string>

Flags fornecidas via linha de comando. Podem ser modificadas antes de invocar build() para alterar a execução das tarefas de entrada e saída.

function successMessage(...messages: any[])

Imprime as mensagens especificadas, concatenadas com a string ' - ' e com a cor verde.

function errorMessage(...messages: any[])

Imprime as mensagens especificadas, concatenadas com a string ' - ' e com a cor vermelha.