Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
parrot-core
Advanced tools
parrot-core abstracts the matching, logging, and resolving functionality of Parrot away from each implementation. parrot-middleware and parrot-fetch use parrot-core and any new implementations could extend parrot-core in a similar way.
import Parrot from 'parrot-core';
class ParrotNew extends Parrot {
constructor(scenarios) {
super(scenarios);
// any constructor logic that is needed
}
normalizeRequest = request => {
// conform incoming requests to match the scenarios structure
};
resolver = request => response => {
// resolve the matched response to the implementation platform
};
}
export default ParrotNew;
parrot-core also defines several methods that can be used to interact with the scenarios that are passed in.
getActiveScenario()
Returns the name of the currently active scenario.
setActiveScenario(name)
Sets the currently active scenario.
name
(String): Scenario name.getScenarios()
Returns an array of scenario objects.
setScenarios(scenarios)
Sets scenarios
as the array of available scenarios.
scenarios
(Array or Object): Scenarios descriptor.getScenario(name)
Returns the scenario object with matching name
.
name
(String): Scenario name.setScenario(name, mocks)
Sets the mocks for scenario with matching name
.
name
(String): Scenario name.mocks
(Array): Array of mock objects.getMock(name, index)
Returns the mock at index
for scenario with matching name
.
name
(String): Scenario name.index
(Number): Mock index.setMock(name, index, mock)
Sets the mock at index
for scenario with matching name
.
name
(String): Scenario name.index
(Number): Mock index.mock
(Object): Mock object.FAQs
Common Parrot functionality.
The npm package parrot-core receives a total of 445 weekly downloads. As such, parrot-core popularity was classified as not popular.
We found that parrot-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.