Sha256: a0c1498774a7c1ff2fafe24b070f7d33c46a7dcf41c7f5b6ed595ce04599dae7

Contents?: true

Size: 982 Bytes

Versions: 3

Compression:

Stored size: 982 Bytes

Contents

"use strict";

exports.__esModule = true;
exports.save = save;
exports.load = load;
exports.get = get;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var _path = require("path");

var _path2 = _interopRequireDefault(_path);

var _fs = require("fs");

var _fs2 = _interopRequireDefault(_fs);

var _homeOrTmp = require("home-or-tmp");

var _homeOrTmp2 = _interopRequireDefault(_homeOrTmp);

var FILENAME = process.env.BABEL_CACHE_PATH || _path2["default"].join(_homeOrTmp2["default"], ".babel.json");
var data = {};

function save() {
  _fs2["default"].writeFileSync(FILENAME, JSON.stringify(data, null, "  "));
}

function load() {
  if (process.env.BABEL_DISABLE_CACHE) return;

  process.on("exit", save);
  process.nextTick(save);

  if (!_fs2["default"].existsSync(FILENAME)) return;

  try {
    data = JSON.parse(_fs2["default"].readFileSync(FILENAME));
  } catch (err) {
    return;
  }
}

function get() {
  return data;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gulp_assets-1.0.0.pre.5 template/node_modules/babel-core/lib/babel/api/register/cache.js
gulp_assets-1.0.0.pre.4 template/node_modules/babel-core/lib/babel/api/register/cache.js
gulp_assets-1.0.0.pre.3 template/node_modules/babel-core/lib/babel/api/register/cache.js