
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
ts-npm-package-boilerplate-2024
Advanced tools
This TypeScript NPM package boilerplate is designed to kickstart the development of TypeScript libraries for Node.js and the browser. It features a modern build setup with TypeScript, leveraging tsup
for bundling and @changesets/cli
for version management. The package exports a simple function as an example to demonstrate the setup.
.nvmrc
)pnpm
(Follow pnpm installation guide if you haven't installed it)First, clone the existing repository simonorzel26/npm-package-boilerplate-2024
to your local machine. This step involves copying all the files from the original repository.
git clone https://github.com/simonorzel26/npm-package-boilerplate-2024.git <your-new-repository-name>
cd <your-new-repository-name>
Since you're creating a new project, you'll likely want to start with a clean history:
rm -rf .git
This command removes the .git
directory which contains all the git history of the original repository.
Now, initialize a new git repository:
git init
git add .
git commit -m "Initial commit based on npm-package-boilerplate-2024"
Go to GitHub and create a new repository named <your-new-repository-name>
. Do not initialize it with a README, .gitignore, or license since you are importing an existing project.
Link your local repository to the GitHub repository and push the changes:
git remote add origin https://github.com/<your-username>/<your-new-repository-name>.git
git branch -M main
git push -u origin main
Replace <your-username>
with your GitHub username.
To use this boilerplate for your project, clone the repository and install the dependencies.
pnpm install
After installation, you can start using the boilerplate to build your TypeScript library. Here's how to import and use the example function exported by this package:
import { foo } from 'your-package-name';
console.log(foo('Hello, world!'));
This package includes several scripts to help with development:
pnpm run build
: Compiles the TypeScript source code and generates both CommonJS and ESM modules along with type definitions.pnpm run lint
: Runs TypeScript compiler checks without emitting code to ensure type safety.pnpm run release
: Bundles the package and publishes it to NPM with version management.To add a new function, create a .ts
file in the src
directory. For example:
// src/newFunction.ts
export const newFunction = (): void => {
// Implementation here
};
Then, export it from index.ts
:
// src/index.ts
export * from './newFunction';
Contributions are welcome! Please submit a pull request or create an issue for any features, bug fixes, or improvements.
This project is open-sourced under the MIT License. See the LICENSE file for more details.
Simon Orzel
FAQs
TS NPM Package Boilerplate for 2024
We found that ts-npm-package-boilerplate-2024 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.