Socket
Socket
Sign inDemoInstall

vue-template-compiler

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-template-compiler

template compiler for Vue 2.0


Version published
Weekly downloads
1.1M
decreased by-59.73%
Maintainers
1
Weekly downloads
 
Created

What is vue-template-compiler?

The vue-template-compiler package is used to pre-compile Vue.js templates into render functions to achieve faster render times and smaller bundle sizes. It is typically used in build processes with tools like Webpack or Browserify.

What are vue-template-compiler's main functionalities?

Compile template strings

This feature allows you to compile Vue.js template strings into render functions. The `compile` function returns an object containing the render function as a string, which can be used to render Vue components.

const { compile } = require('vue-template-compiler');
const compiled = compile('<div>{{ message }}</div>');
console.log(compiled.render);

Compile template files

This feature is used to parse `.vue` single-file components and extract their template content. The `parseComponent` function returns an object with the template, script, and style parts of the component.

const { parseComponent } = require('vue-template-compiler');
const fs = require('fs');
const source = fs.readFileSync('MyComponent.vue', 'utf-8');
const parsed = parseComponent(source);
console.log(parsed.template.content);

Other packages similar to vue-template-compiler

Keywords

FAQs

Package last updated on 02 May 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc