Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
dynamic-parsers
Advanced tools
npm install dynamic-parsers --save
// Platform is an exported enum in our StringsGenerator Class:
// export enum Platform { WEB = 0, IOS = 1, ANDROID = 2, API = 3 }
const translations = [
{ key: 'HELLO', translations: { en: 'Hello English', fr: 'Hello French' }, platforms: [0, 1, 2] },
{ key: 'ERROR', translations: { en: 'Error English', fr: 'Error French' }, platforms: [0, 1, 2] },
{ key: 'EMAIL_INUSE', translations: { en: 'Email in use English', fr: 'Email in use French' }, platforms: [1, 2] },
];
const { StringsGenerator } = require('dynamic-parsers');
const generator = new StringsGenerator(translations, ['en', 'fr']);
// async/await
(async() => {
const platform = 1; // = Platform.IOS
const zipFile = await generator.generateZip(platform);
fs.writeFileSync('file.zip', zipFile);
})();
// Promise
generator.generateZip(platform).then(zipFile => {
const platform = 2; // = Platform.ANDROID
fs.writeFileSync('file.zip', zipFile);
});
app.get('/generator', async (req, res) => {
const platform = 0; // = Platform.WEB
const zipFile = await generator.generateZip(platform);
res.writeHead(200, {
'Content-Type': 'application/zip',
'Content-Length': zipFile.length
});
return res.end(zipFile);
});
const generator = new StringsGenerator(translations, languages)
param | default | type |
---|---|---|
translations | (required) | Translations |
languages | (required) | string[] |
export enum Platform { WEB = 0, IOS = 1, ANDROID = 2, API = 3 }
export interface Translations {
readonly translations: { [key: string]: string }; // e.g. { en: 'Good Morning', fr: 'Bonjour' }
readonly translatable?: boolean;
readonly platforms: Platform[]; // e.g. [1, 2, 3]
readonly key: string;
}
const crawlerConfig = {
url: 'https://www.example.com/search/result?q=macbook',
itemSelector: 'ul.products-grid .item',
itemDetails: [
{ key: 'name', selector: '.product-name' },
{ key: 'sale', selector: '.product-sale .price' },
{ key: 'price', selector: '.product-details .price' },
{ key: 'image', selector: '.product-image img', attribute: 'data-src' },
]
};
(async () => {
const data = await WebCrawl(crawlerConfig);
console.log("LOG: data", data);
})();
// either "html" or "url" is required
export interface ItemDetailsConfig {
key: string;
selector: string;
attribute?: string;
}
export interface CrawlerConfig {
url?: string;
html?: string;
itemSelector: string;
itemDetails: ItemDetailsConfig[];
}
FAQs
Dynamic Parsers - Strings Files Generator and Web Crawler
We found that dynamic-parsers 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.