Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

incense

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

incense

## install

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

node-incense

install

$ npm install --save incense

incense requires biflora, and socket.io.

$ npm install --save biflora
$ npm install --save socket.io

Usage

server side

var express = require('express'),
	app = express();
var server = require('http').Server(app);
var biflora = require('biflora');

// middleware - biflora resources
app.use( biflora.clientLibs() );
biflora.setupWebSocket(
	server,
	require('incense').getBifloraApi() ,
	require('incense').getBifloraMain({
		'dataDir': '/path/to/datadir/', // <- data directory (Read/Write permission required)
		'getUserInfo': function( socket, clientDefaultUserInfo, callback ){
			// provide user info.
			// eg: {'id': 'user_id', 'name': 'User Name'}
			callback(clientDefaultUserInfo);
			return;
		}
	})
);

// middleware - frontend documents
app.use( express.static( '/path/to/htdocs/' ) );

server.listen( 3000, function(){
	console.log('message: server-standby');
} );

client side

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>passiful/incense</title>

		<!-- incense -->
		<link rel="stylesheet" href="./common/dist/incense.css" />
	</head>
	<body>
		<h1>passiful/incense</h1>
		<div class="test-wrap">
			<div id="testBoardElement"></div>
			<div id="testTimelineElement"></div>
		</div>

		<!-- socket.io -->
		<script src="/socket.io/socket.io.js" type="text/javascript"></script>

		<!-- biflora -->
		<script src="/biflora/biflora.js" type="text/javascript"></script>

		<!-- incense -->
		<script src="./common/dist/incense.js" type="text/javascript"></script>

		<!-- initialize code -->
		<script>
			window.incense = new Incense();
			incense.init(
				{
					'elmBoard': document.getElementById('testBoardElement'),
					'elmTimeline': document.getElementById('testTimelineElement'),
					'boardId': 1234567890, // <- discussion board name
					'userInfo': {
						'id': 'tester', // <- login user id
						'name': 'Test User' // <- login user name
					}
				},
				function(){
					console.log('incense standby.');
				}
			);
		</script>
	</body>
</html>
API
  • incense.init( options, callback ) : 初期化する
  • incense.getUserInfo() : ログインユーザーの情報を取得する
  • incense.getBoardId() : ボードIDを取得する
  • incense.getWidgetList( callback ) : ウィジェットの一覧を取得する
  • incense.sendMessage( msg, callback ) : メッセージを送信する

更新履歴 - Change log

incense@0.1.0 (2017-12-29)

  • サーバーサイドに getUserInfo() オプション追加
  • ボードデータ格納ディレクトリパスの生成規則を変更。2文字ずつ分割してパスを生成するようになった。

incense@0.0.1 (2016-12-26)

  • initial release.

ライセンス - License

Copyright (c)2016 Tomoya Koyanagi, and Passiful Project
MIT License https://opensource.org/licenses/mit-license.php

作者 - Author

FAQs

Package last updated on 29 Dec 2016

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