npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

txt-editor

v1.0.0

Published

Basic text/.txt edit

Downloads

6

Readme

txt-editor

test
A modular text based AI module for javascript and node js

How To Use

Editing TxtSetting

const { TxtSetting, TxtFileEditor, StringEditor } = require('@visualarchive/txt-editor');

TxtSetting.Separator = '\n' // Is the chunk separator.
TxtSetting.Default() // resets the settings to default

Editing a .txt File

⚠ Warning:
Make sure to use editor.Save() after to save the edit to the text file or you can save it as its string form with editor.Output.

To edit a text file using txt-editor require the @visualarchive/txt-editor packet from the npm and create a new TxtFileEditor class.

const { TxtSetting, TxtFileEditor, StringEditor } = require('@visualarchive/txt-editor');

const editor = TxtFileEditor.build(PATH);
  • PATH is the directory to the .txt file you want to use.

Prefixes, Suffixes, and Replace

Using ChunkPrefix, ChunkSuffix, FindReplace alows you to edit text in the text file.

editor.ChunkPrefix(STRING);

editor.ChunkSuffix(STRING);

editor.FindReplace(FIND, REPLACE , MAX);
  • STRING is the value that will be used as the prefix/sufix.
  • FIND is the value that will be replaced.
  • REPLACE is the value that will replace the FIND value.
  • MAX is the max cap you want for replaces (leave blank for inf).

Inserting, Removing, and Saving

Using Insert, Remove, Save alows you to more precisely edit the text file.

editor.Insert(INDEX, TEXT);

editor.Remove(MININDEX, MAXINDEX);

editor.Save();
  • INDEX is the value that text will go in.
  • MININDEX is the value that will be the starting point index zone.
  • MAXINDEX is the value that will be the ending point index zone.
  • TEXT is the value that will replace the the values in the index zone.

Editing a String

To edit a text file using txt-editor require the @visualarchive/txt-editor packet from the npm and create a new StringEditor class.

const { TxtSetting, TxtFileEditor, StringEditor } = require('@visualarchive/txt-editor');

const editor = StringEditor.build(STRING);
  • STRING is the string you want to edit like a text file.

Prefixes, Suffixes, and Replace

Using ChunkPrefix, ChunkSuffix, FindReplace alows you to edit text in the text file.

editor.ChunkPrefix(STRING);

editor.ChunkSuffix(STRING);

editor.FindReplace(FIND, REPLACE , MAX);
  • STRING is the value that will be used as the prefix/sufix.
  • FIND is the value that will be replaced.
  • REPLACE is the value that will replace the FIND value.
  • MAX is the max cap you want for replaces (leave blank for inf).

Inserting and Removing

Using Insert, Remove alows you to more precisely edit the text file.

editor.Insert(INDEX, TEXT);

editor.Remove(MININDEX, MAXINDEX);
  • INDEX is the value that text will go in.
  • MININDEX is the value that will be the starting point index zone.
  • MAXINDEX is the value that will be the ending point index zone.
  • TEXT is the value that will replace the the values in the index zone.

Summary

StringEditor

|Properties|Info| |:---|:---| |Output: String|The output unsaved data of StringEditor. READ ONLY| |Prefix: String|The prefix before the chunk. READ ONLY| |Suffix: String|The suffix after the chunk. READ ONLY|

TxtFileEditor

|Properties|Info| |:---|:---| |Output: String|The output unsaved data of TxtFileEditor. READ ONLY| |Prefix: String|The prefix before the chunk. READ ONLY| |Suffix: String|The suffix after the chunk. READ ONLY| |Path: String|The path to the text file. READ ONLY|

TxtSetting

|Properties|Info| |:---|:---| |Separator: String|The chunk separator. ‎ㅤ|

StringEditor

|Properties| |:---| |ChunkPrefix(STRING: String): void _____________________________________________________________________________________ The text added at the beginning of the chunk.| |ChunkSuffix(STRING: String): void _____________________________________________________________________________________ The text added at the end of the chunk.| |FindReplace(FIND: String, REPLACE: String , MAX: Intger): void _____________________________________________________________________________________ Finds and replaces text.| |Insert(INDEX: Intger, TEXT: String): void _____________________________________________________________________________________ Removes the text in the index zone.| |Remove(MININDEX: Intger, MAXINDEX: Intger): void _____________________________________________________________________________________ Removes the text in the index zone.|

TxtFileEditor

|Properties| |:---| |ChunkPrefix(STRING: String): void _____________________________________________________________________________________ The text added at the beginning of the chunk.| |ChunkSuffix(STRING: String): void _____________________________________________________________________________________ The text added at the end of the chunk.| |FindReplace(FIND: String, REPLACE: String , MAX: Intger): void _____________________________________________________________________________________ Finds and replaces text.| |Insert(INDEX: Intger, TEXT: String): void _____________________________________________________________________________________ Removes the text in the index zone.| |Remove(MININDEX: Intger, MAXINDEX: Intger): void _____________________________________________________________________________________ Removes the text in the index zone.| |Save(): void _____________________________________________________________________________________ Saves the changes from the TxtFileEditor.|

TxtSetting

|Properties| |:---| |Default(): void _____________________________________________________________________________________ Sets settings to default.|


|Contact o visualarchive|Made With ooo| |:---:|:---:|