Socket
Book a DemoInstallSign in
Socket

app-meta

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-meta

Access meta data about an application.

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

app-meta

Access meta data about an application.

Travis build status Code Climate Test Coverage Dependency Status devDependency Status

A common feature that I include in my client side apps is meta information about the application itself. Three common values are:

  • the version of the app
  • the commit SHA that is deployed
  • the environment that the app is running in

This library provides a simple method to store and access those bits of data that you can use across all of your apps.

Getting Started

Set up your server to send over the meta data as data attributes on the html element. This might look like:

<html
  lang='en'
  data-version='<%= version %>'
  data-sha='<%= sha %>',
  data-env='<%= env %>'
  >

Then, require in this library.

import meta from 'path/to/app-meta';

console.log(
  'Got some data:', 
  meta.VERSION,
  meta.SHA,
  meta.ENV
);

Browser Support

Should work in IE6+

Module Support

It exports UMD, so it's compatible with AMD, CJS, and as a browser global (window.meta).

Keywords

app

FAQs

Package last updated on 07 Aug 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