Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Automatically create mock objects and JSON from TypeScript interfaces via Faker
Mocking library to create mock objects and JSON for TypeScript interfaces via Faker.
This is not an officially supported Google product.
npm install intermock
Intermock exposes a CLI, which is the recommended way to use the tool. The following subsections show an example file, command, and output to demonstrate using the CLI.
interface Admin extends User {
adminRecord: AdminRecord;
}
interface Student extends User {
schoolRecord: SchoolRecord;
}
interface User {
firstName: string;
lastName: string;
username: string;
emailAddress: string;
}
interface AdminRecord {
studentsPassedEachYear: number[];
}
interface SchoolRecord {
startDate: string;
endDate: string;
isActive: boolean;
grades: number[];
}
node ./node_modules/intermock/build/src/cli/index.js --files ./example-file.ts --interfaces "Admin"
{
"Admin": {
"firstName": "Willa",
"lastName": "Walker",
"username": "Shyann_Mante",
"emailAddress": "Cristobal_Rutherford73@gmail.com",
"adminRecord": {
"studentsPassedEachYear": [
80342,
23404,
12854,
74937,
38185,
73316
]
}
},
Intermock’s API exports only one function, as seen below:
// Returns an object or string based on `output` property specified in `Options`
mock(options: Options): object|string
export interface Options {
// Array of file tuples. (filename, data)
files?: Array<[string, string]>;
// TypeScript is currently the only supported language
language?: SupportedLanguage;
// Specific interfaces to write to output
interfaces?: string[];
// Used for testing mode,
isFixedMode?: boolean;
// One of object|json|string. Strings have their object's functions
// stringified.
output?: OutputType;
// Should optional properties always be enabled
isOptionalAlwaysEnabled?: boolean;
}
The following TypeScript features are supported:
interface Host {
/** @mockType {internet.ipv6} */
addr: string;
}
npm run build
If you want to run the build script and tests after you save a file while developing,
run the following command:
npm run test-watch
To develop documentation run the following commands:
npm run build
npm run docs-serve
Edit the files in docs/
and Webpack's Dev Server should auto-reload when there are changes
To build the docs statically run the following command:
npm run build
npm run docs-build
CONTRIBUTING.md
in this reponpm run ci
npm run format
. DO NOT fix linting errors by disabling the linter on a line and/or block)See LICENSE
in this repo
FAQs
Automatically create mock objects and JSON from TypeScript interfaces via Faker
The npm package intermock receives a total of 7,531 weekly downloads. As such, intermock popularity was classified as popular.
We found that intermock 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.