
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Write once, deploy everyWear. Cross platform development tools for wearables.
A cross platform development framework for wearables.
Use strapkit to generate a new project with Strap Metrics built right in. More to follow.
0.0.1
See LICENSE
Strap Kit requires git, python, node, and npm at a minimum, and platform specific SDK's like Pebble and Android Wear to build for those platforms. To check your dependencies, you can run the command below (requires curl and bash). For a full run down of how to install the dependencies, go to the full developer docs.
$> curl http://check-config.straphq.com | bash
$> sudo npm install strapkit -g
$> strapkit create TestProject
OR
$> strapkit create ./TestProject com.testproject TestProject
strapkit create generates a starter app.js in ./TestProject/js. This is where you write your app using the API documentation below.
$> strapkit platform add pebble android-wear
OR, to add just one platform only, you may specify that platform by itself.
$> strapkit platform add pebble
Removing platforms is just as easy as adding them.
$> strapkit platform remove pebble
$> strapkit build
OR, to compile for one platform only, you may specify just that platform.
$> strapkit build pebble
If you wish to forego using Strap kit to install your app, the compiled binary of your app is available in a "build" folder after running the Strap kit build command.
# When not using pebble
$> strapkit install
# IP Required for pebble
$> strapkit install Phones.IP.Goes.Here
Publish 'n' Profit!
A Page is the container for all your app's UI. When you create a new page, you are bringing the user to a different set of looks and actions.
var splashPage = StrapKit.UI.Page();
var card = StrapKit.UI.Card({
title: 'Weather App',
body:'Loading data now...'
});
// Adds content to a Page
splashPage.addView(card);
// Tells your wearable app to show this page
splashPage.show();
var page = StrapKit.UI.Page();
OR
var page = StrapKit.UI.Page(cardView);
var page = StrapKit.UI.Page([textView, anotherView]);
page.addView(textView);
page.show();
Card is a standard wearable UI component across all platforms. This UI component typically has a title and a body associated with it, and can be clickable. This must be added to a Page in order for the component to be shown.
var card = StrapKit.UI.Card({
title: "My First App",
body: "Writing apps are easy with StrapKit JS"
});
myPage.addView(card);
var card = StrapKit.UI.Card({
title: 'My Title', // The title of your card
body: 'My Body', // The body of your card
onClick: function() { // What happens when you click on the card
console.log('My Function');
}
});
card.setOnClick(function() {
console.log("My Card was clicked");
});
TextView is a standard wearable UI component across all platforms. This UI component can show text and a position of your your choosing.
var textView = StrapKit.UI.TextView({
position: "center",
text: "Loading weather data..."
});
myPage.addView(textView);
StrapKit.UI.TextView({
position: 'center|right|left'
// center: puts text center justified within your page
// right: puts text right justified within your page
// left (default): puts text left justified within your page
});
ListView is a standard wearable UI competent across all platforms. This UI component will show a list of items defined by you. And Item will contain a title and a subtitle as strings. To make the app more interactive, you can attach an object to and Item as data.
var menuItems = [
{
title: 'My Title 1',
subtitle: 'My Subtitle 1',
data: {info: "My Info 1"}
},
{
title: 'My Title 2',
subtitle: 'My Subtitle 2',
data: {info: "My Info 2"}
}];
var resultsMenu = StrapKit.UI.ListView({
items: menuItems
});
resultsMenu.setOnItemClick(function(e) {
console.log(JSON.stringify(e.item));
// { "title":"My Title 1","subtitle":"My Subtitle 1","data":{"info":"My Info 1"}}
console.log(e.itemIndex);
// 0
});
myList.setOnItemClick(function(e) {
e.item // returns the item you clicked on containing title, subtitle and data
e.itemIndex // returns the index of the item you clicked on
});
HttpClient allows you to access API clients outside of the wearable app.
StrapKit.HttpClient(
{
url:'http://api.openweathermap.org/data/2.5/forecast?q=London',
type:'json'
},
function(data) {
console.log(JSON.stringify(data));
},
function(error) {
console.log(error);
}
);
StrapKit.HttpClient({
// url: url to call
// method: 'POST', 'GET', 'UPDATE', etc
// data: { 'username': 'myUsername'}
// headers: { 'Authorization': 'Token: 0sdknweeksokdf0'}
}, success, failure);
With StrapKit JS, adding Strap Metrics to your app is a breeze.
Initializing Strap Metrics allows you to immediately get access to diagnostics and sensor data. You can then log events that are specific to your app.
var app_id = "8djanek08sdjk";
StrapKit.Metrics.init(app_id); // Metrics will start logging sensor data
// Log an event
StrapKit.Metrics.logEvent("/myfirstevent/winning");
// Log an event with data
var myInfo = {info: "This was easy"};
StrapKit.Metrics.logEvent("/myfirstevent/data", myInfo);
StrapKit JS can leverage native geolocation in Javascript to get the location of the device. A callback can be used to extract the position from the successful function. The generic form of this method is:
navigator.geolocation.getCurrentPosition(success, failure, options);
if (navigator && navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
console.log("Got geolocation!");
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
}, function() {
console.log("Failed to get geolocation!");
}, {
maximumAge: 50000,
timeout: 5000,
enableHighAccuracy: true
});
}
FAQs
Write once, deploy everyWear. Cross platform development tools for wearables.
The npm package strapkit receives a total of 16 weekly downloads. As such, strapkit popularity was classified as not popular.
We found that strapkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.