
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vue template to es6 string

npm i vut2ts -g
# single file
vut2ts ./src/demo.vue
# directory
vut2ts ./src
<template>
<ul>
<li v-for="item in houseList" class="houseItem" :class="{'xixi':item.id==123}">
<h1 :houseId="item.id">{{ item.title }}</h1>
<img v-if="item.img" :src="item.img">
</li>
</ul>
</template>
<script lang="ts">
export class House {
img: string
title: string
id: number
}
export default {
setup(ctx, houseList: House[]) {
return {houseList};
},
};
</script>
vut2ts ./demo.vue
let fun = new Function("str", "data", `return (function (str, data) {var tmpData=data||{}; var tmp=""; with (tmpData) { try { tmp = eval(str); } catch (e) { console.warn(str +"not exits in data","\\n",new Error(e)); } } return tmp; } )(str, data);`)
export class House {
img: string
title: string
id: number
}
const _tmp = {
setup(ctx, houseList: House[]) {
return {houseList};
},
};
export default {
expData: fun,
setup(ctx, houseList: House[]) {
let data = {}
if (typeof _tmp["data"] == "function") {
data = _tmp["data"]();
}
let methods = {}
if (typeof _tmp["methods"] == "object") {
methods = _tmp["methods"]
}
// @ts-ignore
let setupData = _tmp.setup(...arguments);
Object.assign(this, data, setupData, methods);
},
toString() {
let str = `<ul>${(() => {
var str = "";
let _tmpItem;
if (this['item']) {
_tmpItem = this['item']
}
this.expData('houseList', this).forEach(item => {
this['item'] = item;
str += `<li class="${(this.expData('true', this) ? 'houseItem' : '') + ' ' + (this.expData('item.id==123', this) ? '"xixi"' : '')}"><h1 houseId="${this.expData('item.id', this)}">${this.expData('item.title', this)}</h1>
${(() => {
if (this.expData('item.img', this)) {
return `<img src="${this.expData('item.img', this)}"/>`
}
return ''
})()}
</li>` });
this['item'] = _tmpItem;
return str
})()}
</ul>
`
return str
}
};
// test.ts
import {House} from "./Demo";
import Demo2 from "./Demo";
const data: House[] = [
{
img: "http://xxx.com/a.png",
title: "hello word",
id: 123
},
{
img: "http://xxx.com/b.png",
title: "nice vut2ts",
id: 456
}
]
Demo2.setup(null, data);
let str = Demo2.toString();
console.log(str)
output
<ul>
<li class="houseItem xixi"><h1 houseId="123">hello word</h1>
<img src="http://xxx.com/a.png"/>
</li>
<li class="houseItem"><h1 houseId="456">nice vut2ts</h1>
<img src="http://xxx.com/b.png"/>
</li>
</ul>
FAQs
vue template to es6 string
The npm package vut2ts receives a total of 0 weekly downloads. As such, vut2ts popularity was classified as not popular.
We found that vut2ts 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.