Skip to content

Formats txt files so that no line is longer than a certain length, without breaking mid-word.

License

Notifications You must be signed in to change notification settings

wilsocr88/txt-auto-spacer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TXT Auto-Spacer

If you're like me and sometimes share text files in a medium that indiscriminately cuts lines of text short (like a CLI terminal), then you could probably use a script to format your text files so a linebreak doesn't happen in the middle of a word and it's all handled automatically. Look no further.

Formats a txt file so that lines are no longer than a certain length (default is 80 characters) without breaking in the middle of a word. Line breaks will be placed at the location of the last space character before the line limit was reached.

Example

Turns this:

long lines

Into this:

lines at 80 characters long

Requirements

NodeJS/NPM/NPX

Configuration

The config.js file is where you set the relative path of your input file and output file. You can also configure the maximum length of each line in the output file.

Use

No package dependencies, so no install command is required.

Configure your in and out files, then run npm run start or node main.

About

Formats txt files so that no line is longer than a certain length, without breaking mid-word.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published