
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.
teason is a cli that takes TypeScript definitions and generates both JSON schema and JSON mock data.
Some might call it a TSON generator
Take a look at the examples to understand what teason does
Examples can be found in the /examples directory
npm i teason
After installing you will be able to run the command npx teason --help
Teason requires two things to run
Not defining
output-pathswill result in no output (a dry-run)
Changing
validation-keywordswill remove the default value (faker)
Options:
-t, --types-folder <folder> folder path with typescript types
-i, --interface-name <name> main interface to begin with
-j, --json-output-path <file_path> output file to store the generated JSON
-s, --schema-output-path <file_path> output file to store the generated Schema
-v, --validation-keywords <comma separated list> keywords of extra annotation to accept ex: "title,test,data" (default: ["faker"])
-h, --help output usage information
You can also store your config in a .teasonrc file
{
"typesFolder": "types",
"interfaceName": "Database",
"jsonOutputPath": "out.json",
"schemaOutputPath": "out.schema.json",
"validationKeywords": ["faker"]
}
The schema output can be used to validate or create new JSON data.
validation with ajv and/or creating with json-editor github
Mock data that conforms to your schema. Can be extended with @faker annotations to create more realistic data
Uses typescript-json-schema, json-schema-faker and faker.js under the hood.
The output from teason is not optimized for json-server, but it can be done quite easily.
The quickest way is to use normalizr and define a normalizr.schema (not to be confused with a json schema).
/examples/post-process.ts contains what you need. In most cases you will only have to change the result of getDbSchema() to get the script working for you
FAQs
Generates JSON schema and JSON data from typescript definitions
The npm package teason receives a total of 8 weekly downloads. As such, teason popularity was classified as not popular.
We found that teason 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.