
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Appendit allows you easily to add text at a specific line. It will works with any plain text format like ```.txt``` ```.md``` ```.js``` ...
Appendit allows you easily to add text at a specific line. It will works with any plain text format like .txt
.md
.js
...
npm install --save appendit
Below a quick example how to use appendit:
The index.html
looks like that:
<html>
<head>
<title></title>
<!-- anchor -->
</head>
<body>
</body>
</html>
Call the appendit
function with the following parameters:
var fs = require('fs');
var appendit = require('appendit');
var content = appendit({
source: fs.readFileSync('index.html', 'utf8'),
anchor: '<!-- anchor -->',
content: [
'<script src="main.js"></script>'
]
});
fs.writeFileSync('index.html', content);
Output:
<html>
<head>
<title></title>
<script src="main.js"></script>
<!-- anchor -->
</head>
<body>
</body>
</html>
###One more
Let's add a headline to the body:
appendit({
source: fs.readFileSync('index.html', 'utf8'),
anchor: '</body>',
content: [
'<h1>Hello Node!</h1>'
]
})
Output:
<html>
<head>
<title></title>
<script src="main.js"></script>
<!-- anchor -->
</head>
<body>
<h1>Hello Node!</h1>
</body>
</html>
Running npm test
will run the unit tests with mocha
FAQs
Appendit allows you easily to add text at a specific line. It will works with any plain text format like ```.txt``` ```.md``` ```.js``` ...
The npm package appendit receives a total of 3 weekly downloads. As such, appendit popularity was classified as not popular.
We found that appendit 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.