<commit_before>### foreachline
Do something for each line of a file with JS 

### Install 
```bash 
npm install -g foreachline
```

### Usage 
If you are a javascript fan who loves to do all your tasks with javascript , then foreachline is for you. 

To use foreachline , you have to install it from npm and use the following command line.

```bash 
foreachline src.txt logic.js 
```
or 

```bash 
fel src.txt logic.js res.txt
```
Use ``foreachline`` or just ``fel`` .

#### Arguments 
- ``src.txt`` - Source file for data.
- ``logic.js`` - contains logic for mapping the data.
- ``res.txt`` [Optional] - Results will be written to ``res.txt`` if specified , else will be written back to ``src.txt``.

### What can you do ? 
 Transform data . Be it a silly to-do list or 50 lines of code , map them  the way you want. 
 
 Lets say you have the following source file ``src.txt``
 ```
Apple
Orange
Banana
 ```
 All you need to do is writing a JS file to map data on each line to new data. 
 
 while creating a JS file , you just need to know one thing . foreachline provides you 2 variables to operate on your data.They are ``line`` and ``lineNumber``
 
 Lets say you want to add lines numbers on each line of ``src.txt``
 Then ``logic.js`` would look like 
 ```javascript 
 line = lineNumber + "." + line ;
 ```
 and you will have 
 ```
1.Apple
2.Orange
3.Banana
```

 If you want to convert them to html list elements
```javascript
line = "<li>" + line + "</li>" ; 
```
and you will have 
```
<li>Apple</li>
<li>Orange</li>
<li>Banana</li>
```

If you want to create JavaScript objects 
```javasctipt 
line = { id : lineNumber , name : line };
```
and you will have 
```
{"id":1,"name":"Apple"}
{"id":2,"name":"Orange"}
{"id":3,"name":"Banana"}
```

and I can continue giving examples all night.


### Plans 
Currently the main plan is making a web version of foreachline which will allow people to use it on web browser.
Web version will include a way of distributing your logic.js snippets with the community. The primary of distributing will be done via gists. 

### Contributing 
Contributions are welcome in order to implement the future plans and also enhance the current version of foreachline. 

Whatever you have in your mind , lets discuss. [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/scriptnull/foreachline?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

### License 
This tool is licensed under the [MIT License](https://github.com/scriptnull/foreachline/blob/master/LICENSE). <commit_msg>silly typo<commit_after>### foreachline
Do something for each line of a file with JS 

### Install 
```bash 
npm install -g foreachline
```

### Usage 
If you are a javascript fan who loves to do all your tasks with javascript , then foreachline is for you. 

To use foreachline , you have to install it from npm and use the following command line.

```bash 
foreachline src.txt logic.js 
```
or 

```bash 
fel src.txt logic.js res.txt
```
Use ``foreachline`` or just ``fel`` .

#### Arguments 
- ``src.txt`` - Source file for data.
- ``logic.js`` - contains logic for mapping the data.
- ``res.txt`` [Optional] - Results will be written to ``res.txt`` if specified , else will be written back to ``src.txt``.

### What can you do ? 
 Transform data . Be it a silly to-do list or 50 lines of code , map them  the way you want. 
 
 Lets say you have the following source file ``src.txt``
 ```
Apple
Orange
Banana
 ```
 All you need to do is writing a JS file to map data on each line to new data. 
 
 while creating a JS file , you just need to know one thing . foreachline provides you 2 variables to operate on your data.They are ``line`` and ``lineNumber``
 
 Lets say you want to add lines numbers on each line of ``src.txt``
 Then ``logic.js`` would look like 
 ```javascript 
 line = lineNumber + "." + line ;
 ```
 and you will have 
 ```
1.Apple
2.Orange
3.Banana
```

 If you want to convert them to html list elements
```javascript
line = "<li>" + line + "</li>" ; 
```
and you will have 
```
<li>Apple</li>
<li>Orange</li>
<li>Banana</li>
```

If you want to create JavaScript objects 
```javasctipt 
line = { id : lineNumber , name : line };
```
and you will have 
```
{"id":1,"name":"Apple"}
{"id":2,"name":"Orange"}
{"id":3,"name":"Banana"}
```

and I can continue giving examples all night.


### Plans 
Currently the main plan is making a web version of foreachline which will allow people to use it on web browser.
Web version will include a way of distributing your logic.js snippets with the community. The primary of distributing will be done via gists. 

### Contributing 
Contributions are welcome in order to implement the future plans and also to enhance the current version of foreachline. 

Whatever you have in your mind , lets discuss. [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/scriptnull/foreachline?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

### License 
This tool is licensed under the [MIT License](https://github.com/scriptnull/foreachline/blob/master/LICENSE). 
{'fraction_non_alphanumeric': 0.12051988972036234, 'fraction_numerical': 0.004332414336352895, 'mean_word_length': 3.8417540514775976, 'pattern_counts': {'":': 12, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7161209', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1501, 'n_words': 684}