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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cloud-directory-mapper

v0.1.0

Published

Cloud Directory Mapper for AWS Cloud Directory

Downloads

5

Readme

Cloud Directory Mapper for AWS Cloud Directory

Copyright (C) Clouden 2018 Author Kenneth Falck [email protected] 2018

Overview

This is an experimental JavaScript mapper for managing AWS Cloud Directory content using dynamic object facets defined with TypeScript.

Installation

To add the library to your project:

npm install --save cloud-directory-mapper

Usage

To define a dynamic object facet:

import { CloudDirectoryMapper, dynamicObjectFacet, attribute } from 'cloud-directory-mapper'
import * as AWS from 'aws-sdk'

@dynamicObjectFacet()
class Post {
  @attribute()
  postId: string

  @attribute()
  title: string

  @attribute()
  content: string
}

To create a mapper instance connected to CLOUD_DIRECTORY_ARN (environment variable):

const cloudDirectory = new AWS.CloudDirectory()
const cloudDirectoryMapper = new CloudDirectoryMapper(cloudDirectory, process.env.CLOUD_DIRECTORY_ARN)

To create a new child object under a known parent object (/posts) using the link name postId:

const post = new Post()
post.postId = '123'
post.title = 'hello world'
post.content = 'longer content'
await mapper.createObject(post, '/posts', postId)

To retrieve child objects of a known parent object:

const posts = [] as Post[]
for await (const post of mapper.getChildObjects(Post, '/posts')) {
  posts.push(post)
}

To retrieve a single child object of a known parent object using the link name postId:

const postId = '123'
const post = await mapper.getObject(Post, '/posts', postId)

To update the retrieved child object:

post.title = 'foo bar'
await mapper.updateObject(post)

Note that Cloud Directory Mapper automatically keeps track of the objectId of the Post object retrieved using getObject(). This allows the updateObject() to work without specifying any path or object identifier.