
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@aurahelper/languages
Advanced tools
Language Libraries to work with XML, Aura, Apex... files. tokenizers, parsers, system classes and much more
Aura Helper Languages Module has usefull inner modules to work with all supported Salesforce languages (Apex, Javascript, Aura...)
You can Tokenize and Parse any apex class to get data from classes like name, variables, methods, constructors... Also you can format your apex classes using the Apex Formatter class
Like Apex classes, you can Tokenize and Parse XML Aura Files and Aura Javascript files with Aura and Javascript modules.
To parse any XML file to process it, you can use the XML Module and its classes to parse prepare and process any XML File.
The languages module has a system module too, to get System apex classes data or Lightning Aura componetns defined on salesforce.
Module with classes to tokenize Apex Classes or Parse Apex Classes to extract classes data like variables, fields, methods, constructors...
tokenize(filePathOrContent, systemData)
Method to tokenize an Apex file
Method to tokenize an Apex file
String
Object
Returns an array with all file tokens
String
Tokenize an Apex Class
const { Apex } = require('@aurahelper/languages');
const ApexTokenizer = Apex.ApexTokenizer;
const tokens = ApexTokenizer.tokenize('./path/to/apex/class.cls');
console.log(tokens);
Class to format any Apex Class with a selected configuration to format code as you want
Method to get a default formatter config object
format(pathContentOrTokens, config)
Method to format an Apex Class with the selected options
Method to get a default formatter config object
Returns a default formatter config object
Get default apex formatter config
const { Apex } = require('@aurahelper/languages');
const ApexFormatter = Apex.ApexFormatter;
const config = ApexFormatter.config();
console.log(config);
Method to format an Apex Class with the selected options
String
| Array<Token>
ApexFormatterConfig
| Object
Object
Returns the Apex Class content formatted
String
This method can throw the next exceptions:
WrongDatatypeException
: If pathContentOrTokens datatype is not an String, path or file tokensWrongFilePathException
: If the file Path is not a String or can't convert to absolute pathFileNotFoundException
: If the file not exists or not have access to itInvalidFilePathException
: If the path is not a fileFormat apex class from file
const { Apex, System } = require('@aurahelper/languages');
const ApexFormatter = Apex.ApexFormatter;
const filePath = 'path/to/apexClass.cls';
const formatedClassStr = ApexFormatter.format(filePath);
console.log(formatedClassStr);
Format apex class from file content
const { Apex } = require('@aurahelper/languages');
const ApexFormatter = Apex.ApexFormatter;
const fileContent = 'public class ApexclassName {' +
'private String property1 { get; set; }' +
'private void privateMethod(String param1, Integer param2) {' +
'// Method body' +
'}';
'public String publicMethod(Map<String, List<Account>>) {' +
'// Method body' +
'}' +
'}';
const formatedClassStr = ApexFormatter.format(fileContent);
console.log(formatedClassStr);
Format apex class from file tokens
const { Apex } = require('@aurahelper/languages');
const ApexFormatter = Apex.ApexFormatter;
const ApexTokenizer = Apex.ApexTokenizer;
const filePath = 'path/to/apexClass.cls';
const fileTokens = ApexTokenizer.tokenize(filePath);
const formatedClassStr = ApexFormatter.format(fileTokens);
console.log(formatedClassStr);
Module with classes to tokenize Aura XML Files or Parse Aura XML Files to extract data from applications, components or events like RegisteredEvents, Handlers, Attributes...
Module with classes to tokenize Aura JS Files or Parse Aura JS Files to extract methods data from Controller and Helper files
Module with classes to parse any XML file to extract data and process it
Module with one class and to many JSON files with Salesforce System Apex Classes and Namespaces and System Aura Components from all Namespaces (aura, lightning, ui...). Use the system class to get this data.
[2.1.6 - 2023-12-27]
FAQs
Language Libraries to work with XML, Aura, Apex... files. tokenizers, parsers, system classes and much more
The npm package @aurahelper/languages receives a total of 27 weekly downloads. As such, @aurahelper/languages popularity was classified as not popular.
We found that @aurahelper/languages 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.