https://github.com/bsdelf/scripts
Scripts, might be helpful.
https://github.com/bsdelf/scripts
Last synced: 3 months ago
JSON representation
Scripts, might be helpful.
- Host: GitHub
- URL: https://github.com/bsdelf/scripts
- Owner: bsdelf
- License: mit
- Created: 2016-10-06T11:21:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T03:43:27.000Z (almost 4 years ago)
- Last Synced: 2025-02-13T05:44:53.546Z (4 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scripts
Scripts, might be helpful.## online.js
Strip leading "./" for the output of `find` command:
```sh
find . | online.js "({line}) => line.replace(/^.\//, '')"
```Get the third column for the output of `wc` command:
```sh
wc README.md | online.js "({columns}) => columns[2]"
```Count word frequency:
```sh
echo 'a\nb b\nc c c\nd d d d' | online.js "({columns, context}) => columns.forEach(word => context[word] = (context[word] >>> 0) + 1)" "context => context"
```