Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mockci
Advanced tools
Readme
This is the npm package to use the MockCI API.
MockCI creates a DynamoDB compatible endpoint that you can use and throwaway. This allows you to test all you DynamoDB related code locally with minimal changes.
install:
npm install mockci
# or
yarn add mockci
example usage:
import { MockCIPrefab, MockCISession } from 'mockci'
import { DynamoDBClient, ScanCommand, ScanCommandInput } from "@aws-sdk/client-dynamodb";
type DynamoDBItem = {
id: string
value: string
}
async function generateDdbEndpoint() {
const prefab: MockCIPrefab = {
"dynamodb": {
"tables": [
{
"seedData": [
{
"id": generateName(),
"value": "seeded value"
}
],
"name": "generic-table",
"attributes": [
{ "name": "id", "type": "S" },
],
"hashKey": "id"
}
]
}
}
const endpointBlob = await MockCISession.start({ prefab })
return endpointBlob.dynamodbEndpoint
}
async function listDDBItems(ddbClient: DynamoDBClient): Promise<DynamoDBItem[]> {
const params: ScanCommandInput = {
TableName: 'generic-table',
}
const data = await ddbClient.send(new ScanCommand(params));
return data.Items.map((element) => ({
id: element.id.S,
value: element.value.S,
}))
}
//this is optional, you can try out the DynamoDB mock without using an API key,
//if you reach the api limits of anonymous sessions,
//head to [the [MockCI]()](https://mockci.cloud/signup) website to get a free API key.
MockCISession.setAPIKey('YOUR_API_KEY_HERE')
generateDdbEndpoint()
.then((endpoint) => {
let ddbClient = new DynamoDBClient({
region: 'us-east-1',
endpoint,
credentials: {
//if you're in the browser this is required (but can be any value)
//if you're in Node and have a local AWS profile configure, this is optional
accessKeyId: 'anyvalueworks',
secretAccessKey: 'anyvalueworks',
}
})
return listDDBItems(ddbClient)
})
.then(console.log)
FAQs
This is the npm package to use the MockCI API.
The npm package mockci receives a total of 8 weekly downloads. As such, mockci popularity was classified as not popular.
We found that mockci 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.