
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ts-object-create
Advanced tools
This is a very experimental library that uses code generation to create functions for creating objects. Currently it doesn't work in many scenarios so just don't use this yet.
Say you have some classes like this:
// ./src/classes.ts
export class Main {
name: string;
other: Other;
}
export class Other {
prop: string;
}
You could generate some code based on these classes:
import * as fs from "fs";
const code = getGeneratedCode({
srcRoot: "./src"
files: ["./src/classes.ts"]
});
fs.writeFile("./src/objectFactory.ts", code);
Then this would allow you to do the following:
// ./src/main.ts
import * as objectFactory from "./objectFactory";
import {Other, Main} from "./classes";
const main = objectFactory.Classes.Main.create({
name: "my name",
other: {
prop: "my prop string"
}
});
main instanceof Main; // true
main.other instanceof Other; // true
// serialize it
const json = JSON.stringify(main);
// deserialize it
const newMain = objectFactory.Classes.Main.create(JSON.parse(json));
newMain instanceof Main; // true
newMain.other instanceof Other; // true
FAQs
Object creation that utilizes type information
We found that ts-object-create 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.