
Security News
npm v12 Ships With Install Scripts Off by Default, Begins Deprecating 2FA-Bypass Tokens
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.
fretted-strings
Advanced tools
Marks on your strings and get it's position.
npm i fretted-strings
const assert = require('assert');
const { mark } = require('fretted-strings');
const frets = {};
const content = mark(
`
hogehoge
%%% ^ ^ %%%
%%% p1 p2 %%%
fooo`,
frets,
);
// Function `mark` returns a string which is removed lines enclosed by '%%%' tags from the parameter.
assert.equal(
content,
`
hogehoge
fooo`,
);
// And this function assigns specified location whose name is represented
// as identifier under the `^` character to 2nd parameter.
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);
const { mark } = require('fretted-strings');
setOptions({
tagStart: '<!--%%',
tagEnd: '%%-->',
});
const frets = {};
mark(
`
<html>
<div>hogehoge</div>
<!--%% ^ %%-->
<!--%% p %%-->
</html>
`,
frets,
);
Or
const { mark } = require('fretted-strings');
const marker = new FretsMarker({
tagStart: '<!--%%',
tagEnd: '%%-->',
});
const frets = {};
marker.mark(
`
<html>
<div>hogehoge</div>
<!--%% ^ %%-->
<!--%% p %%-->
</html>
`,
frets,
);
MIT
FAQs
Mark on your strings and get it's position
The npm package fretted-strings receives a total of 1,425 weekly downloads. As such, fretted-strings popularity was classified as popular.
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
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.