Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Create HTML snippets/embeds from URLs using info from oEmbed, Open Graph, meta tags.
Create HTML snippets/embeds from URLs using info from oEmbed, Open Graph, meta tags.
Key feature:
npm install embedza --save
run dev server (with debug messages):
DEBUG=embedza:* npm start
Render player for youtube video:
const Embedza = require('embedza');
const embedza = new Embedza();
embedza.render('https://www.youtube.com/watch?v=JrZSfMiVC88', 'block')
.then(result => {
if (result) console.log(result.html, result.type);
});
});
Creates new Embedza
instance with specified options:
true
for all providers,
default true
..get(key) -> Promise
and .set(key, value) -> Promise
methods. Default stub does nothing.got
docs. For example, you can
customize user agent header.Try to create HTML snippet of requested type by URL.
.info()
.Returns:
result.html
- html coderesult.type
- matched format typeIf url can not be rendered - returns null. On remote errors fails with error info.
Similar to .render()
, but returns object with full url description.
Returns:
result.domain
- domain plugin id ('youtube.com', 'vimeo.com', ...)result.src
- source urlresult.meta
- title, description, siteresult.snippets
- snippets data: type, tags, href, media, htmlIf url info does not exists - returns null. On remote errors fails with error info.
Iterates through domains rules to modify those.
Get domain rule by name.
Rerister new service. If String
passed - enable domain with default rules.
If Object
passed - create custom configuration:
youtube.com
)Add add data fetcher. Options:
0
.async function (env)
.Add mixin (data handler). Options:
async function (env)
.Add post-processor "after" handler. The same as .addMixin
, but handlers
are axecuted after all mixins. Options:
async function (env)
.By default it's a wrapper for request. You can override it. For example to force use cache only.
Manage available templates:
const _ = require('lodash');
const Embedza = require('embedza');
const embedza = new Embedza();
// Customize templates
embedza.templates['default_inline'] = _.template('...template code...', { variable: 'self' });
embedza.templates['youtube.com_player'] = _.template('...template code...', { variable: 'self' });
// Customize template aliases
embedza.aliases.block = [ 'player', 'photo' ];
Embedza is inspired by projects above, but designed to satisfy our requirements. For example, it supports inline output format.
FAQs
Create HTML snippets/embeds from URLs using info from oEmbed, Open Graph, meta tags.
The npm package embedza receives a total of 4 weekly downloads. As such, embedza popularity was classified as not popular.
We found that embedza 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.