Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
@types/babel__template
Advanced tools
Package description
The @types/babel__template package provides TypeScript type definitions for the babel-template package, which is a part of the Babel toolchain. It allows developers to use Babel's template function in TypeScript projects with type safety. The template function is used to create AST nodes from a string template.
Type-safe template instantiation
This feature allows developers to instantiate Babel templates with type safety, ensuring that the variables and their types are correctly used within the template.
import template from '@babel/template';
import { Statement } from '@babel/types';
const buildRequire = template(`
const IMPORT_NAME = require(SOURCE);
`);
const ast: Statement = buildRequire({
IMPORT_NAME: 'myModule',
SOURCE: '"my-module"'
});
This is the actual implementation of the template function that allows developers to create AST nodes from string templates. It is the package for which @types/babel__template provides type definitions.
This package is the core of the Babel compiler and includes the template functionality. It is more comprehensive than babel-template as it includes the entire Babel compiler API.
Recast is a JavaScript AST manipulation library that provides similar functionality to babel-template, allowing for the parsing, transformation, and printing of JavaScript code. It differs in its API and the fact that it preserves the original formatting of the code as much as possible.
Readme
npm install --save @types/babel__template
This package contains type definitions for @babel/template (https://github.com/babel/babel/tree/master/packages/babel-template).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template.
These definitions were written by Troy Gerwien, Marvin Hagemeister, Melvin Groenhoff, and ExE Boss.
FAQs
TypeScript definitions for @babel/template
The npm package @types/babel__template receives a total of 18,490,216 weekly downloads. As such, @types/babel__template popularity was classified as popular.
We found that @types/babel__template 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.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.