Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cloud-directory-mapper
Advanced tools
Copyright (C) Clouden 2018
Author Kenneth Falck kennu@clouden.net 2018
This is an experimental JavaScript mapper for managing AWS Cloud Directory content using dynamic object facets defined with TypeScript.
To add the library to your project:
npm install --save cloud-directory-mapper
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.
FAQs
Cloud Directory Mapper for AWS Cloud Directory
The npm package cloud-directory-mapper receives a total of 1 weekly downloads. As such, cloud-directory-mapper popularity was classified as not popular.
We found that cloud-directory-mapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.