New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

derive-ts

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derive-ts - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

package.json
{
"name": "derive-ts",
"version": "1.1.0",
"version": "1.1.1",
"author": "Jake Cyr",

@@ -5,0 +5,0 @@ "license": "ISC",

@@ -81,2 +81,4 @@ # Derive TypeScript Interface

### Simple Example
A JavaScript file has been created called 'example.js' with the following contents:

@@ -126,1 +128,50 @@

```
### Example with Sub-Interfaces Generated
A JavaScript file has been created called 'example.js' with the following contents:
```javascript
exports.example = {
address_components: [
{ long_name: '8035', short_name: '8035', types: ['street_number'] },
{ long_name: 'Market Street', short_name: 'Market St', types: ['route'] },
{ long_name: 'Wilmington', short_name: 'Wilmington', types: ['locality', 'political'] },
],
adr_address:
'<span class="street-address">8035 Market St</span>, <span class="locality">Wilmington</span>, <span class="region">NC</span> <span class="postal-code">28411</span>, <span class="country-name">USA</span>',
business_status: 'OPERATIONAL',
formatted_address: '8035 Market St, Wilmington, NC 28411, USA',
formatted_phone_number: '(910) 686-2007',
vicinity: '8035 Market Street, Wilmington',
website:
'https://restaurants.subway.com/united-states/nc/wilmington/8035-market-st?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=60848&utm_campaign=evergreen-2020&y_source=1_MTQ4OTUyNzYtNzE1LWxvY2F0aW9uLmdvb2dsZV93ZWJzaXRlX292ZXJyaWRl',
};
```
After running the following command (notice the `--sub-interfaces` flag in the command)
```bash
derive-ts derive ./example.js --output-file output.ts --interface-name Test --import-name example --sub-interfaces
```
The following file is generated 'output.ts' with the contents:
```typescript
export interface AddressComponents {
long_name: string;
short_name: string;
types: string[];
}
export interface Test {
address_components: AddressComponents[];
adr_address: string;
business_status: string;
formatted_address: string;
formatted_phone_number: string;
vicinity: string;
website: string;
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc