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

biujs

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biujs

bullet screen js library

  • 0.0.11
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

biu.js

biu.js is a JavaScript library for barrage.🔫

How to use

In a browser:

<script src="biu.min.js"></script>
var options = {
  defaultQueue:[
    {text:"biu~biu~biu 一┳═┻︻▄ "}
  ]
}
var biu = new Biu(options);
biu.start();

Using npm:

npm i --save biujs
import Biu from 'biujs';

var options = {
  defaultQueue:[
    {text:"biu~biu~biu 一┳═┻︻▄ "}
  ]
}
var biu = new Biu(options);
biu.start()

Options

instance option

var options = {
  socket:'https://localhost:8360', //websocket server address
  defaultQueue:[{text:'biu',style:{color:'red'}}]    //default barrage list
  defaultQueueInterval:2000,     // show default queue in an random interval based on this field, default 2000.
  duration:10000,    // barrage duration in the page. generate random value based on this field, default 10000.
  minDuration:5000,   //min duration,default 5000
  colors:['#f55b15', '#764ba5', '#00a762', '#0193e6', '#e0463c'],  //text colors,barrage will pick a random color within them. default ['#f55b15', '#764ba5', '#00a762', '#0193e6', '#e0463c']
  onMessage:()=>{}   // callback when a barrage is coming.
}
var biu = new Biu(options);
biu.start();

barrage option

This options means then configuration of specific barrage, it can overwrite the options above. You can custom text,style,duration. For example:

var options = {
  colors:['#f55b15', '#764ba5', '#00a762', '#0193e6', '#e0463c'],  
  duration:10000,
  minDuration:5000
}
var biu = new Biu(options);
biu.start();

var barrage = {
  text:'boss barrage!'
  style:{color:'red','font-size':'300%'},
  duration:2000
}
biu.push(barrage);

Websocket

There are two events you should know if you use your own server side project. By the way, I also provide a server side project , you can use it directly if you want.

  • message: client will emit a message event to server. For example:
  // client side
  biu.send({text:'biu message'});

  // server side
  socket.on('message', function(data) {
    socket.broadcast('push',data)
  });

  • push: server will broadcast a push event to clients. For example:
  // server side
  socket.emit('push', {text:'a message from server'});

  // you needn't do anything on client side, biu will receive 'push' event and send the barrage.

FAQs

Package last updated on 19 Dec 2017

Did you know?

Socket

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.

Install

Related posts

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