
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@99xt/ng2-fileupload
Advanced tools
Simpler file upload implementation for angular2 apps.
To install this library, run:
npm install @99xt/ng2-fileupload --save
example.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { ExampleComponent } from './example.component';
// Import the library
import { FileUploadModule } from '@99xt/ng2-fileupload';
@NgModule({
declarations: [
ExampleComponent
],
imports: [
BrowserModule,
FileUploadModule
],
providers: [],
bootstrap: [ ExampleComponent ]
})
export class ExampleModule { }
example.component.ts
export class ExampleComponent {
allowedTypes: any;
allowedSize: number;
multiple: boolean;
files: any;
constructor() {
this.allowedTypes = [ 'text/markdown' ];
this.allowedSize = 15; // MB
this.multiple = true;
}
onUploadFiles(evt: any) {
if (evt.error) {
throw evt.error;
}
const files = evt.files;
// You can run upload script here
}
}
example.component.html
<file-upload
[allowedTypes]="allowedTypes"
[allowedSize]="allowedSize"
[multiple]="multiple"
(onUploadFiles)="onUploadFiles($event)"
>
</file-upload>
Clone the repository to your workstation
git clone git@github.com:99xt/ng2-fileupload.git
Navigate to the project directory
cd ng2-fileupload
Install and build the library
Generate all
*.js
,*.d.ts
files
npm install
npm run build
You can find the compiled version in the dist/
Create a symlink from the dist
directory to the global node_modules
cd dist
npm link
To lint all *.ts
files:
$ npm run lint
cd demo
npm install
npm start
Update the version in both package.json
and src/package.json
;
npm run build
npm publish dist
MIT
FAQs
Simpler file upload implementation for angular2 apps
The npm package @99xt/ng2-fileupload receives a total of 1 weekly downloads. As such, @99xt/ng2-fileupload popularity was classified as not popular.
We found that @99xt/ng2-fileupload demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.