Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including sfacts with all npm packages installed. Try it out:

var sfacts = require("sfacts")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

sfacts v1.0.1

Facts for SuperScript engine

Build Status Coverage Status Code Climate

sfacts - Scripted Facts

This library reads in table and topic data into tuples for use in SuperScript. It uses the LevelUp interface alongside MongoDown as a backing store.

sfacts supports ChatScript tables and topics.

Note: Before v1.0.0, sfacts used to write to the filesystem using LevelDB. It now writes to MongoDB, to facilitate scaling of SuperScript.


  • clean(dbName, callback)
  • create(dbName, clean, callback)
  • load(dbName, files, clean, callback)

The boolean parameter clean in the create and load methods wipes the existing database if it exists, before creating a new one.

Note: The methods pre-v1.0.0 db and expand are no longer available. The function signatures create and load have changed, and now are required to be called asynchronously (i.e. has a callback parameter).

The return value of create and load is an object:

  • conceptToList(term, [depth,] callback)
  • createUserDB(dbName)
  • createUserDBWithData(dbName, files, callback)
  • db
  • findParentConcepts(term, callback)
  • level
  • loadFiles(files, callback)

Note: The method pre-v1.0.0 loadFile is now named loadFiles. Its behavior is exactly the same.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free