# sen-cli

> SEN - Stream Editor for N00bs

Latest version **1.0.0** (published 2017-10-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install sen-cli
pnpm add sen-cli
yarn add sen-cli
bun add sen-cli
```

Provides the commands `sen`, `sen-add`, `sen-remove`, `sen-replace`, `sen-removelines`.

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-10-08 |
| First published | 2017-10-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vinicius Senna |
| Maintainers | sennav |

## Links

- npm: https://www.npmjs.com/package/sen-cli
- npm.io page: https://npm.io/package/sen-cli

## Dependencies (2)

- [byline](https://npm.io/package/byline.md) ^5.0.0
- [commander](https://npm.io/package/commander.md) git+https://github.com/sennav/commander.js.git

## Recent versions

- 1.0.0 (latest) — 2017-10-08

## README

# SEN - Stream Editor for N00bs (or Normal people)

SEN is a simple stream editor with limited features.
It was designed to work with other tools through UNIX pipes.
Ex find, grep, rp, xargs, etc.

Right now there are only four operations:

* Replace matching pattern.
* Add a line to a specific line number.
* Remove line matching pattern.
* Remove lines by number.

## Install

Sen is installed via [npm](npmjs.com):

```
npm install -g sen-cli

```

## Usage

```
Usage: sen [options] [command]


Options:

-V, --version  output the version number
-h, --help     output usage information


Commands:

replace <toReplace> <replacer> <file>  Replace pattern throughout the stream.
add <lines> <lineToAdd> <file>         Add line at given positions (int comma separated).
remove <pattern> <file>                Remove lines matching pattern.
removelines <lines> <file>             Remove lines at given positions (int comma separated).
help [cmd]                             display help for [cmd]

```

## Examples

Replace:

```
sen replace 'import.*Package' 'import NewPackage' filename.py filename2.py

```
It can be used with file arguments.


Add:

```
cat filename.py | sen add '# My awesome comment' 1

```
It can be used with stdin.

Remove:

```
find . | xargs sen remove -i .bak '# My awesome comment'

```

`-i` can be used to generate backup files.

Remove lines:

```
sen removelines -i 1,2,3 ~/.ssh/known_hosts

```

`-i` without arguments edits the file in place.

---
_Source: https://npm.io/package/sen-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
