
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
tiny-replace-files
Advanced tools
Like vscode, simple utility to quickly replace text in one or more files.
Scene: generate a templates, then replace initName to newName.
# npm
npm install --save tiny-replace-files fast-glob
# yarn
yarn add tiny-replace-files fast-glob
# pnpm
pnpm install --save tiny-replace-files fast-glob
import { replaceStringInFilesSync } from 'tiny-replace-files'
const options = {
files: 'src/targets/index.js',
from: 'test-plugin',
to: 'self-name',
}
# await
const result = replaceStringInFilesSync(options)
console.info(result)
/**
[
{
file: './ques2.md',
changed: true,
matchCounts: 1,
replaceCounts: 1
}
]
*/
import replaceStringInFiles from 'tiny-replace-files'
const options = {
files: 'src/targets/index.js',
from: 'test-plugin',
to: 'self-name',
}
# await
const result = await replaceStringInFiles(options)
console.info(result)
# promise
replaceStringInFiles(options).then((res)=>{
console.info(res)
}).catch(err=>{
console.info(err)
})
const options = {
files: 'file',
};
const options = {
files: [
'file1',
'file2',
'file3',
],
};
const options = {
files: [
'file1',
'file2/**',
]
};
const options = {
from: /foo/g,
to: 'bar',
};
from callbackconst options = {
files: 'file',
from: (file) => new RegExp(file, 'g'),
to: 'bar',
};
to callbackconst options = {
files: './ques2.md',
from: 'quest 2',
to: (match: string) => match.toUpperCase(),
countMatches: true
}
const options = {
ignore: './ignored/file',
};
const options = {
ignore: [
'path/**',
'path2/index.html',
],
};
do not use fast-glob to get path. if you config this, you can uninstall fast-glob for reduce pkg size.
const options = {
disableGlobs: true,
};
glob configurationAPI passed to the fast-glob:
const options = {
glob: {
//Glob settings here
dot: true, //E.g. to include file names starting with a dot
},
};
Use a different character encoding for reading/writing files. Defaults to utf-8.
const options = {
encoding: 'utf8',
};
freeze Runfreeze mode will do not replace & change, just run the process.
const options = {
freeze: true,
};
See CHANGELOG.
FAQs
tiny replace string/regex in files.
The npm package tiny-replace-files receives a total of 106 weekly downloads. As such, tiny-replace-files popularity was classified as not popular.
We found that tiny-replace-files 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.