
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
@playcanvas/attribute-parser
Advanced tools
This is the official JSDoc attribute parser used in the PlayCanvas Editor.
It collects metadata from user scripts by parsing @attribute
JSDoc annotations. These attributes enable the PlayCanvas Editor to expose UI controls and contextual information for your script properties.
Example
Given a script like this:
class Rotator extends ScriptType {
/**
* @attribute
* Speed determines how fast to rotate things
*/
speed = new Vec3();
/**
* @attribute
* An array of Entities to rotate
*
* @type {Entity[]}
*/
thingsToRotate;
}
The parser outputs:
{
"rotator": {
"attributes": {
"speed": {
"type": "vec3",
"name": "speed",
"array": false,
"description": "Speed determines how fast to rotate things",
"default": [0, 0, 0]
},
"thingsToRotate": {
"type": "entity",
"name": "thingsToRotate",
"array": true,
"description": "An array of Entities to rotate",
"default": null
}
},
"errors": []
}
}
JSDocs tags are parsed and values and outputs the metadata in a serializable format.
// Initialise the parser
// Initialize the parser
const parser = new JSDocParser();
await parser.init();
// Load your source files: {[filename: string]: string}[]
const scripts = await fetchScripts([...paths, './playcanvas.d.ts']);
// Update the parser program
parser.updateProgram(scripts);
// Parse attributes from the entry point
const [attributes, errors] = parser.parseAttributes("./index.js");
See the test fixtures for examples of supported JSDoc tags and output formats.
This project includes good test coverage for all supported tag formats and edge cases.
FAQs
The PlayCanvas Attribute Parser
The npm package @playcanvas/attribute-parser receives a total of 229 weekly downloads. As such, @playcanvas/attribute-parser popularity was classified as not popular.
We found that @playcanvas/attribute-parser demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.