@hexlet/immutable-fs-trees
FileSystem Tree
Last updated 16 days ago by corsicanec82 .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @hexlet/immutable-fs-trees 
SYNC missed versions from official npm registry.

js-immutable-fs-trees

github action status

Install

npm install @hexlet/immutable-fs-trees

Usage example

import {
  mkfile, mkdir, isDirectory, isFile, map,
} from '@hexlet/immutable-fs-trees';

isFile(mkfile('config')); // true
isDirectory(mkdir('etc')); // true

const tree = mkdir('etc', [mkfile('config'), mkfile('hosts')]);

const callbackFn = (node) => {
  const { name } = node;
  const newName = name.toUpperCase();
  return { ...node, name: newName };
};

map(callbackFn, tree);
// {
//   name: 'ETC',
//   children: [
//     { name: 'CONFIG', meta: {}, type: 'file' },
//     { name: 'HOSTS', meta: {}, type: 'file' }
//   ],
//   meta: {},
//   type: 'directory',
// }

For more information, see the Full Documentation

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet (in Russian).

Current Tags

  • 0.7.0                                ...           latest (16 days ago)

9 Versions

  • 0.7.0                                ...           16 days ago
  • 0.6.2                                ...           25 days ago
  • 0.5.2                                ...           4 months ago
  • 0.5.1                                ...           5 months ago
  • 0.5.0                                ...           5 months ago
  • 0.4.1                                ...           7 months ago
  • 0.4.0                                ...           7 months ago
  • 0.3.3                                ...           8 months ago
  • 0.3.2                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 11
Last Day 0
Last Week 0
Last Month 17
Dependencies (0)
None
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |