Socket
Socket
Sign inDemoInstall

svelte-preprocess

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-preprocess - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

5

package.json
{
"name": "svelte-preprocess",
"version": "1.1.1",
"version": "1.1.2",
"license": "MIT",

@@ -22,2 +22,3 @@ "main": "src/index.js",

"test:watch": "jest --no-cache --verbose --watchAll",
"release": "npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish",
"prepublishOnly": "npm run test"

@@ -44,3 +45,3 @@ },

"peerDependencies": {
"svelte": "^1.44.0"
"svelte": "^1.44.0 || ^2.0.0"
},

@@ -47,0 +48,0 @@ "optionalPeerDependencies": {

33

README.md

@@ -7,8 +7,19 @@ # Svelte (Magical) Preprocess

### Basic
```js
const svelte = require('svelte')
const magicalPreprocess = require('svelte-preprocess')
svelte.preprocess(input, magicalPreprocess()).then(...)
```
### Advanced
```js
const svelte = require('svelte')
const magicalPreprocess = require('svelte-preprocess')
const magicOpts = {
/** Transform the whole markup before preprocessing */
onBefore({ content,filename }) {
onBefore({ content, filename }) {
return content.replace('something', 'someotherthing')

@@ -47,3 +58,3 @@ },

* <... lang="cst"> or
* <... type="text/cst">
* <... type="text/customLanguage">
* will be treated as the language 'customLanguage'

@@ -85,8 +96,22 @@ */

```html
<div>Hey</div>
<template lang="pug">
div Hey
</template>
<script type="text/coffeescript">
export default
methods:
foo: () ->
console.log('Hey')
</script>
<style src="./style.scss"></style>
<!-- Or -->
<style src="./style.styl"></style>
<!-- Or -->
<style lang="scss">

@@ -99,2 +124,4 @@ $color: red;

<!-- Or -->
<style type="text/stylus">

@@ -101,0 +128,0 @@ $color = red

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc