Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 1.52 KB

README.md

File metadata and controls

69 lines (48 loc) · 1.52 KB

Tabify License Dependency Status Build Status

Simple tabs module.

API

What you should do first is create new instance of tabify with

var tabs = tabify();

Than you could just use API as it is.

tabs.add(tabObject)

Add new tab object which stores needed information about files in tabs list.

tabs.remove(fileName)

Remove tab from tabs list by name of file.

tabs.get([fileName])

Get specific tab or all tabs in case of no argument. FileName should be string.

How to use?

var tabify  = require('tabify'),
    tabs    = tabify(),
    name    = 'README.md';
    
tabs.add({
    name: name,
    path: '/' + name,
    data: 'hello world',
    row: 1,
    column: 5
});

tabs.get();
// returns 
[{
    name: "README.md",
    path: "/README.md",
    data: "hello world",
    row: 1,
    column: 5
}]

tabs.remove(name);

tabs.get();
//returns
[];

License

MIT