Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

get-capsule-name

v0.0.13arrow_drop_down
v0.0.13
v0.0.12
v0.0.11
v0.0.10
v0.0.9
v0.0.8
v0.0.7
v0.0.6
v0.0.5
v0.0.4
v0.0.3
v0.0.2
v0.0.1
STATUS
Passing
DOWNLOADS
13,390
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
3 months ago
SIZE
2 KB
2 contributors
Install get-capsule-name as a package?
Copied
npm i @bit/bit.envs.common.get-capsule-name
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Files
get-capsule-name.ts
10 Lines(9 sloc)
1
2
3
4
5
6
7
8
9
10
11
import path from 'path';
const os = require('os');

export function getCapsuleName(infix: string = '') {
  const uuidHack = `capsule-${infix ? `${infix}-` : ''}${Date.now()
    .toString()
    .slice(-5)}`;
  const targetDir = path.join(os.tmpdir(), 'bit', uuidHack);
  return targetDir;
}