Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

prevOpen Source→SEO Editornext

seo-editor

Copywriting keyword to-do list automation

Downloads per monthMIT LicensePlayground
  • the top
  • IDEA
  • API — EDITOR()
  • API — VERSION

Idea

When copywriting, typically you have a to-do list of keywords to place and a word length requirement.

This program:

  • counts which keywords from to-do list have been mentioned
  • counts the words
  • calculates to-do label length compensation, necessary to list something on the right along the same axis
  • supports one or more copy chunks to evaluate against

In short, it automates a keyword-oriented copywriting environment.

API — editor()

The main function editor() is imported like this:

It’s a function which takes two input arguments:

Input argumentTypeObligatoryDescription
todo
Type: String
Obligatory: yes
todoStringyesTo-do keyword list in markdown
copy
Type: String
Obligatory: yes
copyStringyesOne or more markdown chunks of copy, separated by “---”

The function will return a plain object of a shape:

Key’s nameTypeDescription
todoLines
Type: Array of plain objects
todoLinesArray of plain objectsArray of results, one for each todo line.
chunkWordCounts
Type: Array of numbers
chunkWordCountsArray of numbersArray of lengths, one for each copy chunk. Separate the chunks by ”---“.
todoTotal
Type: Number or zero
todoTotalNumber or zeroTotal of todo lines interpreted by the program as to-do list entries (starts with ”- “, dash-space).
completion
Type: Number array
completionNumber arrayThe result.
log
Type: Plain object
logPlain objectVarious statistics.

Each todoLines plain object has the following shape:

Key’s nameTypeDescription
extracted
Type: String
extractedStringWhole to-do label extracted and trimmed. Can be multiple words.
length
Type: Number
lengthNumberString length of extracted label.
counts
Type: Array of numbers
countsArray of numbersHow many times this keyword has been met in each chunk in copy.
lengthCompensation
Type: Number
lengthCompensationNumberCounting continuous list rows, how much does this line needs to be extended to align something on the right on the even axis?

API — version

You can import version:

↑ back to top
prev next

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab