Socket
Socket
Sign inDemoInstall

ntee

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ntee

Portable Unix shell command 'tee', with some extras - read from standard input and write to standard output and files


Version published
Maintainers
1
Install size
7.41 kB
Created

Changelog

Source

v2.0.0 - 2019-05-26

  • Rewrite without dependencies
    • It now properly streams data. Before, all stdin data was buffered in memory.
  • Add prettier and editorconfig files
  • Update documentation
  • Add CHANGELOG file

Readme

Source

ntee

Portable Unix shell command tee, with some extras — read from standard input and write to standard output and files.

TL;DR

gulp.dest() in middle of a pipe? NPM scripts can do as well:

{
  "scripts": {
    "less": "lessc main.less | postcss --use autoprefixer | ntee main.css | cleancss > main.min.css"
  }
}

Install

$ npm install -g ntee

Check

$ ntee --help

Use

Usage:
  ntee [OPTION]... FILE...

  Copy standard input to each FILE, and also to standard output.

Options:
  -a, --append              append to the given FILEs, do not overwrite
  -i, --ignore-interrupts   ignore interrupt signals
  -s, --suppress            do not output to stdout
  -v, --version             display the current version
  -h, --help                display help and usage details
$ whoami | ntee file1.txt file2.txt

Will print current user to stdout and also to file1.txt and file2.txt. Note that if these files already exist, they will be overwritten. Use -a/--append to avoid it, just like you would do with Richard Stallman's tee:

$ whoami | ntee -a i-wont-be-overwritten.txt

-i/--ignore-interrupts will prevent CTRL+C from killing ntee. Won't work on windows.

I also added an -s/--suppress option to suppress output to stdout. This meant to be used on npm scripts:

$ echo "Nothing will be shown in screen" | ntee -s but-it-will-be-saved-here.txt

You can always pipe:

cat long.log | sort | ntee sorted.log | head

License

MIT

Keywords

FAQs

Last updated on 25 May 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc