
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@wapc/widl-codegen
Advanced tools
This library works in tandem with wapc/widl-js
to generate waPC
module code in Rust, AssemblyScript, and TinyGo.
$ npm install @wapc/widl
$ npm install @wapc/widl-codegen
const widl = require("@wapc/widl");
const ast = require("@wapc/widl/ast");
const assemblyscript = require("@wapc/widl-codegen/assemblyscript");
const schema = `
namespace "mandelbrot"
interface {
update(width: u32, height: u32, limit: u32): [u16]
}`;
const context = new ast.Context({});
const doc = widl.parse(schema, { noLocation: true });
const writer = new ast.Writer();
const visitor = new assemblyscript.ScaffoldVisitor(writer);
doc.accept(context, visitor);
let source = writer.string();
console.log(source);
<html>
<head>
<script src="https://unpkg.com/prettier@2.2.1/standalone.js"></script>
<script src="https://unpkg.com/prettier@2.2.1/parser-typescript.js"></script>
<script src="https://unpkg.com/@wapc/widl/dist/standalone.min.js"></script>
<script src="https://unpkg.com/@wapc/widl-codegen/dist/standalone.min.js"></script>
</head>
<body>
<pre><code id="generated"></code></pre>
</body>
<script type="text/javascript">
const doc = widl.parse(`namespace "mandelbrot"
interface {
update(width: u32, height: u32, limit: u32): [u16]
}`);
const context = new widl.ast.Context({});
const writer = new widl.ast.Writer();
const visitor = new widl.codegen.assemblyscript.ScaffoldVisitor(writer);
doc.accept(context, visitor);
let source = writer.string();
source = prettier.format(source, {
parser: "typescript",
plugins: prettierPlugins,
});
document.getElementById("generated").innerHTML = source;
</script>
</html>
FAQs
Flexible code generation using WIDL
The npm package @wapc/widl-codegen receives a total of 121 weekly downloads. As such, @wapc/widl-codegen popularity was classified as not popular.
We found that @wapc/widl-codegen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.