
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
fretted-strings
Advanced tools
Marks on your strings and get it's position.
npm i fretted-strings
import assert from 'node:assert';
import { extract } from 'fretted-strings';
const [content, frets] = extract(
`
hogehoge
%%% ^ ^ %%%
%%% p1 p2 %%%
fooo`,
);
// The 1st value of the tuple is a string which is removed lines enclosed by '%%%' tags from the parameter.
assert.equal(
content,
`
hogehoge
fooo`,
);
// The 2nd value of the tuple is an object whose value represents location corresponding to "^" character.
// And names under "^" character are available to use as keys of the object.
assert.equal(frets.p1.pos, 7);
assert.equal(frets.p1.line, 1);
assert.equal(frets.p1.character, 6);
assert.equal(frets.p2.pos, 14);
assert.equal(frets.p2.line, 1);
assert.equal(frets.p2.character, 13);
import { createExtractFn } from 'fretted-strings';
const extract = createExtractFn('<!--%%', '%%-->');
const [content, frets] = extract(
`
<html>
<div>hogehoge</div>
<!--%% ^ %%-->
<!--%% p %%-->
</html>
`,
);
MIT
FAQs
Mark on your strings and get it's position
We found that fretted-strings 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
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.