6.2.14 • Published 11 months ago

@takinola/handy v6.2.14

Weekly downloads
8
License
AGPL-3.0
Repository
github
Last release
11 months ago

Handyjs Documentation

Introduction

Features

Dependencies

Getting Started

API Documentation

Module - System

sendStream

Send responses in data streams

arguments

  • @params {function} func - function that returns data on event 'data'; ends with event 'end' and generates errors with event 'error'
  • @params {string} delimiter - string that is sent to indicate distinct data chuncks ie data1-delimiter-data2-... It should be a string that is unlikely to occur in the data chuncks and should not include repeating patterns
  • @params {object} res - express response object

example

app.get('/path', (req, res)=>{
  const streamFunction = ()=>{ / function that sends data on events}
  const delimiter = '#$%&*()-+=!@~';
  sendStream(streamFunction, delimiter, res)
  .then(()=> / end processing /)
  .catch((err)=> / eror processing /)
})

setCDNHeaders

Set cache control headers when CDN is in use

arguments

  • @params {object} res - Express response object
  • @params {int} age - Maximum caching time (in seconds)
  • @params {string} cacheType - Type of caching allowed (default "private")
  • @params {string} storeType - Type of storage allowd (default "no-store")

example

app.get('/path', (req, res)=>{
  setCDNHeaders(res, 7200, 'public', '');
  res.send({response: 'ok'});  // the response to this request will be cached by the CDN and browsers for 2 hours
})

How handyjs works

License

Credits

6.2.13

11 months ago

6.2.14

11 months ago

6.2.12

1 year ago

6.2.11

1 year ago

6.2.10

1 year ago

6.2.9

1 year ago

6.2.8

1 year ago

6.2.7

1 year ago

6.2.5

2 years ago

6.2.4

2 years ago

6.2.3

2 years ago

6.2.2

2 years ago

6.2.0

2 years ago

6.1.2

2 years ago

6.1.4

2 years ago

6.1.3

2 years ago

6.1.1

2 years ago

6.1.0

2 years ago

6.0.5

2 years ago

6.0.4

2 years ago

6.0.3

2 years ago

6.0.2

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

5.0.12

3 years ago

5.0.11

3 years ago

5.0.10

3 years ago

5.0.9

3 years ago

5.0.8

3 years ago

5.0.7

3 years ago

5.0.6

3 years ago

5.0.5

3 years ago

5.0.4

3 years ago

5.0.3

3 years ago

5.0.2

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.2.46

3 years ago

4.2.45

3 years ago

4.2.44

3 years ago

4.2.43

3 years ago

4.2.42

3 years ago

4.2.41

3 years ago

4.2.40

3 years ago

4.2.39

3 years ago

4.2.38

3 years ago

4.2.37

3 years ago

4.2.34

4 years ago

4.2.33

4 years ago

4.2.32

4 years ago

4.2.31

4 years ago

4.2.3

4 years ago

4.2.2

4 years ago

4.1.716

4 years ago

4.1.715

4 years ago

4.1.714

4 years ago

4.1.713

4 years ago

4.1.711

4 years ago

4.1.710

4 years ago

4.1.709

4 years ago

4.1.708

4 years ago

4.1.707

4 years ago

4.1.706

4 years ago

4.1.705

4 years ago

4.1.704

4 years ago

4.1.703

4 years ago

4.1.702

4 years ago

4.1.701

4 years ago

4.1.700

4 years ago

4.1.70

4 years ago

4.1.605

4 years ago

4.1.604

4 years ago

4.1.603

4 years ago

4.1.602

4 years ago

4.1.601

4 years ago

4.1.6

4 years ago

4.1.5

4 years ago

4.1.355

4 years ago

4.1.354

4 years ago

4.1.353

4 years ago

4.1.352

4 years ago

4.1.351

4 years ago

4.1.349

4 years ago

4.1.348

4 years ago

4.1.347

4 years ago

4.1.346

4 years ago

4.1.345

4 years ago

4.1.344

4 years ago

4.1.343

4 years ago

4.1.342

4 years ago

4.1.341

4 years ago

4.1.340

4 years ago

4.1.339

4 years ago

4.1.338

4 years ago

4.1.337

4 years ago

4.1.336

4 years ago

4.1.335

4 years ago

4.1.334

4 years ago

4.1.333

4 years ago

4.1.332

4 years ago

4.1.331

4 years ago

4.1.330

4 years ago

4.1.329

4 years ago

4.1.328

4 years ago

4.1.327

4 years ago

4.1.326

4 years ago

4.1.325

4 years ago

4.1.324

4 years ago

4.1.323

4 years ago

4.1.322

4 years ago

4.1.321

4 years ago

4.1.320

4 years ago

4.1.319

4 years ago

4.1.318

4 years ago

4.1.317

4 years ago

4.1.316

4 years ago

4.1.315

4 years ago

4.1.314

4 years ago

4.1.313

4 years ago

4.1.312

4 years ago

4.1.311

4 years ago

4.1.310

4 years ago

4.1.309

4 years ago

4.1.308

4 years ago

4.1.307

4 years ago

4.1.306

4 years ago

4.1.305

4 years ago

4.1.304

4 years ago

4.1.303

4 years ago

4.1.302

4 years ago

4.1.301

4 years ago

4.1.300

4 years ago

4.1.299

4 years ago

4.1.298

4 years ago

4.1.297

4 years ago

4.1.296

4 years ago

4.1.295

4 years ago

4.1.294

4 years ago

4.1.293

4 years ago

4.1.292

4 years ago

4.1.291

4 years ago

4.1.290

4 years ago

4.1.289

4 years ago

4.1.288

4 years ago

4.1.287

4 years ago

4.1.286

4 years ago

4.1.285

4 years ago

4.1.284

4 years ago

4.1.283

4 years ago

4.1.282

4 years ago

4.1.281

4 years ago

4.1.280

4 years ago

4.1.279

4 years ago

4.1.278

4 years ago

4.1.277

4 years ago

4.1.276

4 years ago

4.1.275

4 years ago

4.1.274

4 years ago

4.1.273

4 years ago

4.1.272

4 years ago

4.1.271

4 years ago

4.1.270

4 years ago

4.1.269

4 years ago

4.1.268

4 years ago

4.1.267

4 years ago

4.1.266

4 years ago

4.1.265

4 years ago

4.1.264

4 years ago

4.1.263

4 years ago

4.1.262

4 years ago

4.1.261

4 years ago

4.1.260

4 years ago

4.1.259

4 years ago

4.1.258

4 years ago

4.1.257

4 years ago

4.1.256

4 years ago

4.1.255

4 years ago

4.1.254

4 years ago

4.1.253

4 years ago

4.1.252

4 years ago

4.1.251

4 years ago

4.1.250

4 years ago

4.1.249

4 years ago

4.1.248

4 years ago

4.1.247

4 years ago

4.1.246

4 years ago

4.1.245

4 years ago

4.1.243

4 years ago

4.1.242

4 years ago

4.1.241

4 years ago

4.1.240

4 years ago

4.1.239

4 years ago

4.1.238

4 years ago

4.1.237

4 years ago

4.1.236

4 years ago

4.1.235

4 years ago

4.1.234

4 years ago

4.1.233

4 years ago

4.1.232

4 years ago

4.1.231

4 years ago

4.1.230

4 years ago

4.1.229

4 years ago

4.1.228

4 years ago

4.1.227

4 years ago

4.1.226

4 years ago

4.1.225

4 years ago

4.1.224

4 years ago

4.1.223

4 years ago

4.1.222

4 years ago

4.1.221

4 years ago

4.1.220

4 years ago

4.1.219

4 years ago

4.1.218

4 years ago

4.1.217

4 years ago

4.1.216

4 years ago

4.1.215

4 years ago

4.1.213

4 years ago

4.1.212

4 years ago

4.1.211

4 years ago

4.1.210

4 years ago

4.1.209

4 years ago

4.1.208

4 years ago

4.1.207

4 years ago

4.1.206

4 years ago

4.1.205

4 years ago

4.1.204

4 years ago

4.1.203

4 years ago

4.1.202

4 years ago

4.1.201

5 years ago

4.1.2

5 years ago

4.1.115

5 years ago

4.1.114

5 years ago

4.1.113

5 years ago

4.1.112

5 years ago

4.1.111

5 years ago

4.1.110

5 years ago

4.1.109

5 years ago

4.1.108

5 years ago

4.1.107

5 years ago

4.1.106

5 years ago

4.1.105

5 years ago

4.1.104

5 years ago

4.1.103

5 years ago

4.1.102

5 years ago

4.1.101

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.29

5 years ago

4.0.28

5 years ago

4.0.27

5 years ago

4.0.26

5 years ago

4.0.25

5 years ago

4.0.24

5 years ago

4.0.23

5 years ago

4.0.22

5 years ago

4.0.21

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago