npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aka-archiver

v0.1.0

Published

Back up your Akamai GTM configuration as JSON files

Downloads

3

Readme

Build Status

aka-archiver

A Node-based CLI tool and NPM module that saves Akamai GTM configuration to local JSON files & git.

aka-archiver also offers Akamai GTM restoration functionality.

Why?

Akamai provides no rollback functionality, version control, or backups of GTM domain, property, and data center configuration.

aka-archiver saves GTM configuration to JSON files. The JSON can be used to restore your Akamai GTM configuration should it disappear or be problematically modified.

Installation

npm install -g aka-archiver

Usage

aka-archiver can be used as an NPM module or as a CLI.

Module usage

aka-archiver's API leverages JavaScript promises.

Basic Usage, TL;DR

Back up all GTM configuration and commit/push the JSON configuration to a git repo:

var Archiver = require('aka-archiver'),
    archiver = new Archiver({
      clientToken: 'yourClientToken',
      clientSecret: 'yourClientSecret',
      accessToken: 'yourAccessToken',
      edgegridHost: 'yourEdgegridHost'
    });

archiver.all()
  .then(archiver.archive)
  .then(function(msg) {
    console.log(msg);
  });
});

Note that this defaults to origin, master.

To declare a specific remote & branch:

var Archiver = require('aka-archiver'),
    archiver = new Archiver({
      clientToken: 'yourClientToken',
      clientSecret: 'yourClientSecret',
      accessToken: 'yourAccessToken',
      edgegridHost: 'yourEdgegridHost',
      remote: 'your_remote',
      branch: 'your_branch'
    });

Full API

var Archiver = require('aka-archiver'),
    archiver = new Archiver({
      clientToken: 'yourClientToken',
      clientSecret: 'yourClientSecret',
      accessToken: 'yourAccessToken',
      edgegridHost: 'yourEdgegridHost'
    });

archiver.all('yourdomain').then(function() {
  console.log('saved full GTM configuration to local JSON files!');
}, function(err) {
  // handle error
});

archiver.domain('yourdomain').then(function() {
  console.log('saved GTM domain configuration to local JSON file!');
}, function(err) {
  // handle error
});

archiver.properties('yourdomain').then(function() {
  console.log('saved GTM properties configuration to local JSON file!');
}, function(err) {
  // handle error
});

archiver.dataCenters('yourdomain').then(function() {
  console.log('saved GTM data centers configuration to local JSON file!');
}, function(err) {
  // handle error
});

archiver.archive().then(function() {
  console.log('Pushed local GTM JSON backup to git repository!');
}, function(err) {
  // handle error
});

archiver.restore('yourdomain_domain.json').then(function() {
  console.log('Restored GTM configuration to that contained in yourdomain_domain.json');
}, function(err) {
  // handle error
});

Commandline usage

Set the following environment variables the proper values based on your Akamai account:

AKAMAI_EDGEGRID_CLIENT_TOKEN
AKAMAI_EDGEGRID_CLIENT_SECRET
AKAMAI_EDGEGRID_ACCESS_TOKEN
AKAMAI_EDGEGRID_HOST

Save all the GTM configuration:

aka-archive all yourdomain.akadns.net

Result:

  • yourdomain.akadns.net_domain.json
  • yourdomain.akadns.net_properties.json
  • yourdomain.akadns.net_dataCenters.json

Save only domain configuration:

aka-archive domain yourdomain.akadns.net

Save only properties configuration:

aka-archive properties yourdomain.akadns.net

Save only data centers configuration:

aka-archive dataCenters yourdomain.akadns.net

Restore a GTM configuration, given a yourdomain.akadns.net_domain.json GTM domain backup:

aka-archive restore yourdomain.akadns.net_domain.json