
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
LTSV parser and formatter
$ npm install ltsv
var ltsv = require('ltsv');
ltsv.parse([
'label1:value1\tlabel2:value2',
'label1:value1\tlabel2:value2',
'label1:value1\tlabel2:value2'
].join('\n'));
// [ { label1: 'value1', label2: 'value2' },
// { label1: 'value1', label2: 'value2' },
// { label1: 'value1', label2: 'value2' } ]
ltsv.parseLine('label1:value1\tlabel2:value2');
// { label1: 'value1', label2: 'value2' }
ltsv.parseLine('label1:value1\tlabel2:value2\n');
// { label1: 'value1', label2: 'value2' }
ltsv.parseLine('label1:value1\tlabel2:value2\r\n');
// { label1: 'value1', label2: 'value2' }
ltsv.format([
{ label1: 'value1', label2: 'value2' },
{ label1: 'value1', label2: 'value2' },
{ label1: 'value1', label2: 'value2' }
]);
// 'label1:value1\tlabel2:value2\nlabel1:value1\tlabel2:value2\nlabel1:value1\tlabel2:value2'
ltsv.formatLine({ label1: 'value1', label2: 'value2' });
// 'label1:value1\tlabel2:value2'
var fs = require('fs'),
ltsv = require('ltsv'),
ltjs = ltsv.createLtsvToJsonStream({
toObject: false,
strict: false
});
// access.log:
// l1:v1\tl2:v2\n
// l1:v1\tl2:v2\n
// l1:v1\tl2:v2\n
fs.createReadStream('./access.log').pipe(ltjs).pipe(process.stdout);
// {"l1":"v1","l2":"v2"}{"l1":"v1","l2":"v2"}{"l1":"v1","l2":"v2"}
text string - LTSV textreturn Object[] - parsed objectssplit to LTSV records.
throw SyntaxError if text has no separator.
line string - LTSV linereturn Object - parsed objectsplit to LTSV record.
throw SyntaxError if line has no separator.
text string - LTSV textreturn Object[] - parsed objectssplit to LTSV records and validate label and value of fields.
throw SyntaxError if text has no separator.
also throw SyntaxError if text has unexpected character.
line string - LTSV linereturn Object - parsed objectsplit to LTSV record.
throw SyntaxError if line has no separator.
also throw SyntaxError if line has unexpected character.
mixed Object|Object[] - object or object arrayreturn string - LTSV textconvert to LTSV text.
throw TypeError if mixed is not an object or array.
mixed Object|Object[] - object or object arrayreturn string - LTSV textconvert to LTSV text.
throw TypeError if mixed is not an object or array.
also throw SyntaxError if mixed has unexpected character.
options object - option objectreturn LtsvToJsonStream - LTSV to JSON streamreturn LtsvToJsonStream instance.
encoding string - StringDecoder encodingtoObject boolean - flag of send to objectstrict boolean - flag of strict parseStringDecoder's encoding.
if not set, use "utf8".
send object if toObject is true.
otherwise send JSON string.
if not set, toObject is false.
strict parse if strict is true.
otherwise not strict parse.
if not set, strict is false.
$ npm install
$ npm test
The MIT License. Please see LICENSE file.
FAQs
LTSV parser, formatter, validator and TransformStream
The npm package ltsv receives a total of 482 weekly downloads. As such, ltsv popularity was classified as not popular.
We found that ltsv 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.