
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.
svelte-upgrade
Advanced tools
Upgrade your Svelte templates for compatibility with version 2.
To update all the templates in the src directory:
npx svelte-upgrade v2 src
To update an individual component:
npx svelte-upgrade v2 MyComponent.html
To specify a different output location, instead of writing in place, use the --output (or -o) flag.
If files will be overwritten, you'll be prompted for confirmation. Use --force or -f to bypass the prompt.
Prior to the release of Svelte v2, it is possible to opt in to the new syntax by passing the parser: 'v2' option to the compiler, either directly or via your rollup-plugin-svelte or svelte-loader options.
<!-- before -->
<div class="item {{active ? 'highlighted' : ''}}">
{{name}}
</div>
<!-- after -->
<div class="item {active ? 'highlighted' : ''}">
{name}
</div>
<!-- before -->
{{#if foo}}
<p>foo</p>
{{elseif bar}}
<p>bar</p>
{{else}}
<p>neither foo nor bar</p>
{{/if}}
<!-- after -->
{#if foo}
<p>foo</p>
{:elseif bar}
<p>bar</p>
{:else}
<p>neither foo nor bar</p>
{/if}
<!-- before -->
<ul>
{{#each cats as cat @name}}
<li><a target='_blank' href={{cat.video}}>{{cat.name}}</a></li>
{{/each}}
</ul>
<!-- after -->
<ul>
{#each cats as cat (cat.name)}
<li><a target='_blank' href={cat.video}>{cat.name}</a></li>
{/each}
</ul>
<!-- before -->
<:Window on:resize='handleResize()'/>
<!-- after -->
<svelte:window on:resize='handleResize()'/>
<!-- before -->
<:Component {Thing}/>
<!-- after -->
<svelte:component this={Thing}/>
<!-- before -->
<Foo :bar/>
<!-- after -->
<Foo {bar}/>
<!-- before -->
<div class='blog-post'>
{{{post.content}}}
</div>
<!-- after -->
<div class='blog-post'>
{@html post.content}
</div>
<!-- before -->
<button on:click="store.set({ clicked: true })">click me</button>
<!-- after -->
<button on:click="$set({ clicked: true })">click me</button>
FAQs
Upgrade Svelte templates
We found that svelte-upgrade 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.