
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
plain-text-data-to-json
Advanced tools
Transform a “database” / basic (word, phrase) list from plain text to JSON.
This package is ESM only: Node 12+ is needed to use it and it must be imported
instead of required.
npm:
npm install plain-text-data-to-json
var fs = require('fs')
var toJSON = require('plain-text-data-to-json')
var doc = fs.readFileSync('input.txt', 'utf8')
var data = toJSON(doc)
fs.writeFileSync('output.json', JSON.stringify(data, null, 2) + '\n')
This package exports the following identifiers: toJson.
There is no default export.
toJson(value[, options])Transforms the given value (string) to JSON. Don’t like the default comment and property-value pair delimiters? Specify your own:
optionsoptions.commentCharacter(s) to use for line-comments, false turns off comments (string,
Array.<string>, or boolean, default: '%')
options.delimiterCharacter to use as delimiter between property-value pairs (string, default:
':')
options.forgivingHow relaxed to be ('fix' or boolean, default: false).
When true, doesn’t throw for duplicate keys.
When 'fix', doesn’t throw for property-value pairs and overwrites (see
errors).
options.logWhether to log when forgiving ignores an error (boolean, default: true).
I found myself rewriting a simple transformation over and over. This (verbosely named) project fixes that. It might not be useful, or too simple for others, but suites my use cases.
The term plain text might be confusing. It’s actually more of some (sparingly specified) standard.
Use a percentage sign (by default) to specify a comment. The comment will last until the end of line.
% This is a completely commented line.
unicorn % This is a partially commented line.
Yields:
['unicorn']
Initial or final white space (\s) is trimmed from values.
unicorn % some value
Yields:
['unicorn']
Empty lines are striped. This includes blank (whitespace only) lines.
%%% this file contains a value. %%%
unicorn
Yields:
['unicorn']
If a line includes a colon (by default), the library returns an object.
unicorn : magic creature
Yields:
{unicorn: 'magic creature'}
All other lines are treated as array values.
unicorn
Yields:
["unicorn"]
Some errors are thrown when malformed “plain-text” is found, such as:
forgiving: true)forgiving: true)forgiving: "fix")FAQs
Transform a simple plain-text database to JSON
The npm package plain-text-data-to-json receives a total of 38 weekly downloads. As such, plain-text-data-to-json popularity was classified as not popular.
We found that plain-text-data-to-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.