
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@onflow/flow-cadut-generator
Advanced tools
Flow Cadut supports Cadence interaction by wrapping template files in Javascript.
Flow Cadut supports Cadence interaction by wrapping template files in Javascript.
The Flow Cadence Template Generator (@onflow/flow-cadut-generator
) is responsible for parsing Cadence (.cdc) template files and translating them to easy-to-use JavaScript (.js) files. The Cadence Template Generator, takes either path to a local folder or url to a Github repository and generates JavaScript files which wrap the Cadence code and facilitate sending the templated interactions to the Flow network.
In order to install the Flow Cadence Template Generator CLI, run the following command to add it to your project's devDependencies
:
npm install -D @onflow/flow-cadut-generator
Note that any generated code will require @onflow/flow-cadut
as a dependency which can be installed by running the following command in your project root:
npm install @onflow/flow-cadut
flow-generate [input] [output]
Generate corresponding JavaScript files from a cadence input folder
Options:
--help Show help [boolean]
--version Show version number [boolean]
-i, --input Cadence input directory or Github repository URL
[string] [default: "./cadence"]
-o, --output Javascript output directory
[string] [default: "./src/generated"]
-b, --branch Git branch to use if git repository used as input [string]
-d, --dependency Dependency to use in generated templates
[string] [default: "@onflow/flow-cadut"]
-w, --watch Whether to run the generator as a standalone build or in
watch mode [boolean] [default: false]
# long flags
npx flow-generate --input ./cadence --output ./src/generated
# short flags
npx flow-generate -i ./cadence -o ./src/generated
# no flags
npx flow-generate ./cadence ./src/generated
For GitHub repositories you can specify branch you want to pull with --branch
or -b
flags. If you omit it, then generator
will default to master/main
branch.
# long flags
npx flow-generate --input https://github.com/onflow/flow-core-contracts --branch feature/epochs --output ./src/generated
# short flags
npx flow-generate -i https://github.com/onflow/flow-core-contracts -b feature/epochs -o ./src/generated
# positional arguments
npx flow-generate https://github.com/onflow/flow-core-contracts ./src/generated -b feature/epochs
# positional arguments, main branch
npx flow-generate https://github.com/onflow/flow-core-contracts ./src/generated
You can also paste full path to specific folder that you want to process. For example:
npx flow-generate https://github.com/onflow/flow-core-contracts/tree/master/contracts ./src/generated
In this specific case, generator would assume that you want to process contracts
folder in the root of repository.
For a slightly more complex case - using Git Flow approach for example - please, specify branch name, so generator can extract folder name properly.
npx flow-generate https://github.com/onflow/flow-core-contracts/tree/feature/epochs/transactions/flowToken ./src/generated -b feature/epochs
FAQs
Flow Cadut supports Cadence interaction by wrapping template files in Javascript.
We found that @onflow/flow-cadut-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.