New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

steroid

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

steroid - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

6

index.js

@@ -6,2 +6,3 @@ /**

var concat = require('lineup-stream')
var through = require('through')

@@ -18,2 +19,7 @@

module.exports = function(arr, ...args) {
if (typeof arr === 'function') {
return through(function (data) {
concat(arr(data)).on('data', (chunk) => this.emit('data', chunk))
})
}
var cp = []

@@ -20,0 +26,0 @@ arr.map((item, idx) => {

5

package.json
{
"name": "steroid",
"version": "1.1.1",
"version": "2.0.0",
"description": "A template engine on steroid.",

@@ -28,4 +28,3 @@ "main": "index.js",

"promises-a": "^2.3.0",
"tape": "^4.6.0",
"through": "^2.3.8"
"tape": "^4.6.0"
},

@@ -32,0 +31,0 @@ "dependencies": {

30

README.md

@@ -22,12 +22,18 @@ # Steroid

```javascript
var html = require('steroid')
var country = 'France'
const html = require('steroid')
const http = require('http')
html`
<article>
<h2>Hello ${country}</h2>
${fetch('/api/weather?' + country).then(weather)}
</article>
`.pipe(dest)
http.createServer((req, res) => {
const country = 'France'
// steroid returns a stream
html`
<article>
<h2>Hello ${country}</h2>
${fetch('/api/weather?' + country).then(weather)}
</article>
`.pipe(res)
}).listen(3000)
function weather(forecast) {

@@ -37,8 +43,10 @@ return html`

Weather is ${forecast.result}
<ul>forecast.cities.map(city => {
return html`<li>${city}</li>`
})</ul>
<ul>${forecast.cities.map(city)}</ul>
</div>
`
}
function city(name) {
return html`<li>${name}</li>`
}
```

@@ -45,0 +53,0 @@

@@ -5,2 +5,3 @@ /**

var Readable = require('stream').Readable
var stream = require('..')

@@ -87,3 +88,29 @@ var through = require('through')

test('should return a duplex stream', assert => {
assert.plan(1)
reader()
.pipe(stream(data => {
return stream`<li>${data}</li>`
}))
.pipe(writer(result => assert.equal(result, '<li>hello</li><li>world</li>')))
})
/**
* Create readable stream.
*/
function reader () {
var readable = new Readable
readable._read = function () {}
readable.push('hello')
setTimeout(function () {
readable.push('world')
readable.push(null)
}, 300)
return readable
}
/**
* Create writable stream.

@@ -90,0 +117,0 @@ */

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