
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
generate-code-context
Advanced tools
This npm package reads all files in a directory (excluding specified ones) and writes their contents to a `.txt` file.
This npm package reads all files in a directory (excluding specified ones) and writes their contents to a .txt file.
npm i generate-code-context
Create a file named generate.js in your project directory.
Add the following code to generate.js:
const { run } = require('generate-code-context');
const path = require('path');
const startDir = __dirname; // Root directory
const excludeDirs = ['node_modules', 'dist', 'build'];
const excludeFiles = ['package.json', 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml'];
const outputFilePath = path.join(__dirname, 'code_context.txt'); // Save in root directory
run(startDir, excludeDirs, excludeFiles, outputFilePath);
Get Gemini API Key from https://aistudio.google.com and paste it in .env file
API_KEY=your_google_api_key_here
node generate.js
FAQs
This npm package reads all files in a directory (excluding specified ones) and writes their contents to a `.txt` file.
We found that generate-code-context demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.