1.1.4 • Published 11 years ago
atom-helpers v1.1.4
atom-helpers
A Node.JS package that provides helpers for Atom.io packages development.
Install
npm install atom-helpersUsage
extends
extends of coffeeScript
class MyView extends Viewto vanilla JS
var helpers = require('atom-helpers');
helpers.extends(MyView, View);See an example of behavior in the unit tests file.
editor
editor.getCurrentBuffer()
Get the current pane buffer.
Returns the buffer atom.workspace.getActivePaneItem().buffer or null.
var buffer = helpers.editor.getCurrentBuffer();buffer === atom.workspace.getActivePaneItem().buffer
editor.getCurrentFile()
Get the current File instance.
Returns an instance of File or null.
// Object: File
var currentFile = helpers.editor.getCurrentFile();currentFile is an instance of File.
editor.getCurrentFilePath()
Get the current file path.
Returns the absolute file path (string) or null
// string: /my-project/the-current-active-file.js
var currentFilePath = helpers.editor.getCurrentFilePath();currentFilePath is the absolute path of the current active file.
Unit tests
atom-helpers is unit tested with Unit.js
Run the tests
cd node_modules/atom-helpers
npm testLICENSE
Author
| Nicolas Talle |
![]() |

