You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

atom-helpers

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atom-helpers

A Node.JS package that provides helpers for Atom.io packages development (e.g: a vanilla JS equivalent of `class MyView extends View`...).

1.1.4
latest
Source
npmnpm
Version published
Weekly downloads
16
700%
Maintainers
1
Weekly downloads
 
Created
Source

atom-helpers

Actual version published on NPM npm module downloads per month

A Node.JS package that provides helpers for Atom.io packages development.

Install

npm install atom-helpers

Usage

extends

extends of coffeeScript

class MyView extends View

to 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 test

LICENSE

MIT license

Author

Nicolas Tallefourtane - Nicolab.net
Nicolas Talle
Make a donation via Paypal

Keywords

atom

FAQs

Package last updated on 18 Apr 2015

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